[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZpiJDdqhDlAb8n6T@infradead.org>
Date: Wed, 17 Jul 2024 20:16:29 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Danilo Krummrich <dakr@...nel.org>
Cc: cl@...ux.com, penberg@...nel.org, rientjes@...gle.com,
iamjoonsoo.kim@....com, akpm@...ux-foundation.org, vbabka@...e.cz,
roman.gushchin@...ux.dev, 42.hyeyoo@...il.com, urezki@...il.com,
hch@...radead.org, kees@...nel.org, ojeda@...nel.org,
wedsonaf@...il.com, mhocko@...nel.org, mpe@...erman.id.au,
chandan.babu@...cle.com, christian.koenig@....com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH 1/2] mm: vmalloc: implement vrealloc()
On Thu, Jul 18, 2024 at 12:24:01AM +0200, Danilo Krummrich wrote:
> +extern void * __must_check vrealloc_noprof(const void *p, size_t size,
> + gfp_t flags) __realloc_size(2);
No need for the extern here.
It would also help readability a bit to keep the __realloc_size on a
separate like, aka:
void *__must_check vrealloc_noprof(const void *p, size_t size, gfp_t flags)
__realloc_size(2);
> + if (size <= old_size) {
> + /* TODO: Can we optimize and shrink the allocation? What would
> + * be a good metric for when to shrink the vm_area?
> + */
Kernel comment style is to keep the
/*
on a line of it's own. A realloc that doesn't shrink is a bit
pointless. The same heuristics as for krealloc should probably apply
here, adjust to the fact that we always deal with whole pages.
> + /* TODO: Can we optimize and extend the existing allocation if we have
> + * enough contiguous space left in the virtual address space?
> + */
I don't understand this comment.
> +EXPORT_SYMBOL(vrealloc_noprof);
New interfaces should be EXPORT_SYMBOL_GPL. That being said for this
to be added an exported we'll need an actual user to start with anyway.
Powered by blists - more mailing lists