linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Wool <vitaly.wool@konsulko.se>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, Uladzislau Rezki <urezki@gmail.com>,
	Danilo Krummrich <dakr@kernel.org>,
	Alice Ryhl <aliceryhl@google.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	rust-for-linux@vger.kernel.org,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Kent Overstreet <kent.overstreet@linux.dev>,
	linux-bcachefs@vger.kernel.org, bpf@vger.kernel.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Jann Horn <jannh@google.com>, Pedro Falcato <pfalcato@suse.de>
Subject: Re: [PATCH v13 1/4] :mm/vmalloc: allow to set node and align in vrealloc
Date: Wed, 30 Jul 2025 19:25:05 +0200	[thread overview]
Message-ID: <B851D9FB-3745-4923-B196-C4D0C618DBF5@konsulko.se> (raw)
In-Reply-To: <aHZnmevtRYt26LBE@casper.infradead.org>



> On Jul 15, 2025, at 4:37 PM, Matthew Wilcox <willy@infradead.org> wrote:
> 
> On Tue, Jul 15, 2025 at 03:57:24PM +0200, Vitaly Wool wrote:
>> +void *__must_check vrealloc_node_align_noprof(const void *p, size_t size,
>> + unsigned long align, gfp_t flags, int nid) __realloc_size(2);
>> +#define vrealloc_node_noprof(_p, _s, _f, _nid) \
>> + vrealloc_node_align_noprof(_p, _s, 1, _f, _nid)
>> +#define vrealloc_noprof(_p, _s, _f) \
>> + vrealloc_node_align_noprof(_p, _s, 1, _f, NUMA_NO_NODE)
>> +#define vrealloc_node_align(...) alloc_hooks(vrealloc_node_align_noprof(__VA_ARGS__))
>> +#define vrealloc_node(...) alloc_hooks(vrealloc_node_noprof(__VA_ARGS__))
>> +#define vrealloc(...) alloc_hooks(vrealloc_noprof(__VA_ARGS__))
> 
> I think we can simplify all of this.
> 
> void *__must_check vrealloc_noprof(const void *p, size_t size,
> unsigned long align, gfp_t flags, int nid) __realloc_size(2);
> #define vrealloc_node_align(...) \
> alloc_hooks(vrealloc_noprof(__VA_ARGS__))
> #define vrealloc_node(p, s, f, nid) \
> alloc_hooks(vrealloc_noprof(p, s, 1, f, nid))
> #define vrealloc(p, s, f) \
> alloc_hooks(vrealloc_noprof(p, s, 1, f, NUMA_NO_NODE))
> 
> 

In this case, to keep things buildable an each step we will need to modify slub.c in this patch. Since we change slub.c in the next patch in the series I would suggest that we keep things simple (== as they are now, even if it means some redundant macros have to stay). I can come up with a macro simplification like yours when this series is accepted.

Thanks,
Vitaly



  reply	other threads:[~2025-07-30 17:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15 13:56 [PATCH v13 0/4] support large align and nid in Rust allocators Vitaly Wool
2025-07-15 13:57 ` [PATCH v13 1/4] :mm/vmalloc: allow to set node and align in vrealloc Vitaly Wool
2025-07-15 14:37   ` Matthew Wilcox
2025-07-30 17:25     ` Vitaly Wool [this message]
2025-07-15 13:58 ` [PATCH v13 1/4] mm/vmalloc: " Vitaly Wool
2025-07-15 14:25   ` Liam R. Howlett
2025-07-15 13:58 ` [PATCH v13 2/4] mm/slub: allow to set node and align in k[v]realloc Vitaly Wool
2025-07-15 14:33   ` Danilo Krummrich
2025-07-15 15:34     ` Vlastimil Babka
2025-07-15 15:48       ` Danilo Krummrich
2025-07-15 16:12         ` Danilo Krummrich
2025-07-25  8:47   ` Vlastimil Babka
2025-07-15 13:58 ` [PATCH v13 3/4] rust: add support for NUMA ids in allocations Vitaly Wool
2025-07-24  9:27   ` Alice Ryhl
2025-07-29  8:25   ` Danilo Krummrich
2025-07-15 13:58 ` [PATCH v13 4/4] rust: support large alignments " Vitaly Wool
2025-07-24  9:27   ` Alice Ryhl
2025-07-24 20:54 ` [PATCH v13 0/4] support large align and nid in Rust allocators Andrew Morton
2025-07-25  7:14   ` Alice Ryhl
2025-07-25  8:26     ` Vlastimil Babka
2025-07-25 10:00   ` Danilo Krummrich

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=B851D9FB-3745-4923-B196-C4D0C618DBF5@konsulko.se \
    --to=vitaly.wool@konsulko.se \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=aliceryhl@google.com \
    --cc=bpf@vger.kernel.org \
    --cc=dakr@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jannh@google.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=pfalcato@suse.de \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=urezki@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /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