linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pedro Falcato <pfalcato@suse.de>
To: Brendan Jackman <jackmanb@google.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	 Vlastimil Babka <vbabka@suse.cz>, Jann Horn <jannh@google.com>,
	linux-kernel@vger.kernel.org,  maple-tree@lists.infradead.org,
	linux-mm@kvack.org
Subject: Re: [PATCH v2 4/4] tools: testing: Use existing atomic.h for vma/maple tests
Date: Mon, 1 Sep 2025 11:29:05 +0100	[thread overview]
Message-ID: <q5chl5fnmaj6wxlj3aclz7n3k4bz5sgjfliao37wdiefi32mgi@wxefcss6cmqp> (raw)
In-Reply-To: <20250828-b4-vma-no-atomic-h-v2-4-02d146a58ed2@google.com>

On Thu, Aug 28, 2025 at 12:28:01PM +0000, Brendan Jackman wrote:
> The shared userspace logic used for unit-testing maple tree and VMA code
> currently has its own replacements for atomics helpers. This is not
> needed as the necessary APIs already have userspace implementations in
> the tools tree. Switching over to that allows deleting a bit of code.
> 
> Note that the implementation is different; while the version being
> deleted here is implemented using liburcu, the existing version in tools
> uses either x86 asm or compiler builtins. It's assumed that both are
> equally likely to be correct.
> 
> The tools tree's version of atomic_t is a struct type while the version
> being deleted was just a typedef of an integer. This means it's no
> longer valid to call __sync_bool_compare_and_swap() directly on it. One
> option would be to just peek into the struct and call it on the field,
> but it seems a little cleaner to just use the corresponding atomic.h
> API whic has been added recently. Now the fake mapping_map_writable() is
> copied from the real one.
> 
> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>

Reviewed-by: Pedro Falcato <pfalcato@suse.de>

> ---
>  tools/testing/shared/linux/maple_tree.h |  6 ++----
>  tools/testing/vma/linux/atomic.h        | 17 -----------------
>  tools/testing/vma/vma_internal.h        | 12 +++---------
>  3 files changed, 5 insertions(+), 30 deletions(-)

Yay, less code! :)

-- 
Pedro


      reply	other threads:[~2025-09-01 10:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28 12:27 [PATCH v2 0/4] " Brendan Jackman
2025-08-28 12:27 ` [PATCH v2 1/4] tools/include: Implement a couple of atomic_t ops Brendan Jackman
2025-09-01 10:27   ` Pedro Falcato
2025-08-28 12:27 ` [PATCH v2 2/4] tools: testing: Allow importing arch headers in shared.mk Brendan Jackman
2025-08-28 12:28 ` [PATCH v2 3/4] tools: testing: Support EXTRA_CFLAGS " Brendan Jackman
2025-08-28 12:28 ` [PATCH v2 4/4] tools: testing: Use existing atomic.h for vma/maple tests Brendan Jackman
2025-09-01 10:29   ` Pedro Falcato [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=q5chl5fnmaj6wxlj3aclz7n3k4bz5sgjfliao37wdiefi32mgi@wxefcss6cmqp \
    --to=pfalcato@suse.de \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=jackmanb@google.com \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=maple-tree@lists.infradead.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox