linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] tools: fix atomic_set() definition to set the value correctly
@ 2024-12-27 22:22 Suren Baghdasaryan
  2025-01-02 14:12 ` Lorenzo Stoakes
  0 siblings, 1 reply; 2+ messages in thread
From: Suren Baghdasaryan @ 2024-12-27 22:22 UTC (permalink / raw)
  To: akpm
  Cc: liam.howlett, lorenzo.stoakes, vbabka, jannh, linux-kernel,
	linux-mm, surenb

Currently vma test is failing because of the new vma_assert_attached()
assertion. The check is failing because previous refcount_set() inside
vma_mark_attached() is a NoOp. Fix the definition of atomic_set() to
correctly set the value of the atomic.

Fixes: 9325b8b5a1cb ("tools: add skeleton code for userland testing of VMA logic")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
---
Applies over mm-unstable

 tools/testing/shared/linux/maple_tree.h | 2 +-
 tools/testing/vma/linux/atomic.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/shared/linux/maple_tree.h b/tools/testing/shared/linux/maple_tree.h
index 06c89bdcc515..f67d47d32857 100644
--- a/tools/testing/shared/linux/maple_tree.h
+++ b/tools/testing/shared/linux/maple_tree.h
@@ -2,6 +2,6 @@
 #define atomic_t int32_t
 #define atomic_inc(x) uatomic_inc(x)
 #define atomic_read(x) uatomic_read(x)
-#define atomic_set(x, y) do {} while (0)
+#define atomic_set(x, y) uatomic_set(x, y)
 #define U8_MAX UCHAR_MAX
 #include "../../../../include/linux/maple_tree.h"
diff --git a/tools/testing/vma/linux/atomic.h b/tools/testing/vma/linux/atomic.h
index 2e2021553196..788c597c4fde 100644
--- a/tools/testing/vma/linux/atomic.h
+++ b/tools/testing/vma/linux/atomic.h
@@ -6,7 +6,7 @@
 #define atomic_t int32_t
 #define atomic_inc(x) uatomic_inc(x)
 #define atomic_read(x) uatomic_read(x)
-#define atomic_set(x, y) do {} while (0)
+#define atomic_set(x, y) uatomic_set(x, y)
 #define U8_MAX UCHAR_MAX
 
 #ifndef atomic_cmpxchg_relaxed
-- 
2.47.1.613.gc27f4b7a9f-goog



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] tools: fix atomic_set() definition to set the value correctly
  2024-12-27 22:22 [PATCH 1/1] tools: fix atomic_set() definition to set the value correctly Suren Baghdasaryan
@ 2025-01-02 14:12 ` Lorenzo Stoakes
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Stoakes @ 2025-01-02 14:12 UTC (permalink / raw)
  To: Suren Baghdasaryan
  Cc: akpm, liam.howlett, vbabka, jannh, linux-kernel, linux-mm

On Fri, Dec 27, 2024 at 02:22:20PM -0800, Suren Baghdasaryan wrote:
> Currently vma test is failing because of the new vma_assert_attached()
> assertion. The check is failing because previous refcount_set() inside
> vma_mark_attached() is a NoOp. Fix the definition of atomic_set() to
> correctly set the value of the atomic.
>
> Fixes: 9325b8b5a1cb ("tools: add skeleton code for userland testing of VMA logic")
> Signed-off-by: Suren Baghdasaryan <surenb@google.com>

LGTM:

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

> ---
> Applies over mm-unstable
>
>  tools/testing/shared/linux/maple_tree.h | 2 +-
>  tools/testing/vma/linux/atomic.h        | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/shared/linux/maple_tree.h b/tools/testing/shared/linux/maple_tree.h
> index 06c89bdcc515..f67d47d32857 100644
> --- a/tools/testing/shared/linux/maple_tree.h
> +++ b/tools/testing/shared/linux/maple_tree.h
> @@ -2,6 +2,6 @@
>  #define atomic_t int32_t
>  #define atomic_inc(x) uatomic_inc(x)
>  #define atomic_read(x) uatomic_read(x)
> -#define atomic_set(x, y) do {} while (0)
> +#define atomic_set(x, y) uatomic_set(x, y)
>  #define U8_MAX UCHAR_MAX
>  #include "../../../../include/linux/maple_tree.h"
> diff --git a/tools/testing/vma/linux/atomic.h b/tools/testing/vma/linux/atomic.h
> index 2e2021553196..788c597c4fde 100644
> --- a/tools/testing/vma/linux/atomic.h
> +++ b/tools/testing/vma/linux/atomic.h
> @@ -6,7 +6,7 @@
>  #define atomic_t int32_t
>  #define atomic_inc(x) uatomic_inc(x)
>  #define atomic_read(x) uatomic_read(x)
> -#define atomic_set(x, y) do {} while (0)
> +#define atomic_set(x, y) uatomic_set(x, y)
>  #define U8_MAX UCHAR_MAX
>
>  #ifndef atomic_cmpxchg_relaxed
> --
> 2.47.1.613.gc27f4b7a9f-goog
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-02 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-27 22:22 [PATCH 1/1] tools: fix atomic_set() definition to set the value correctly Suren Baghdasaryan
2025-01-02 14:12 ` Lorenzo Stoakes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox