From: Christoph Hellwig <hch@infradead.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com,
urezki@gmail.com, hch@infradead.org, kees@kernel.org,
ojeda@kernel.org, wedsonaf@gmail.com, mhocko@kernel.org,
mpe@ellerman.id.au, chandan.babu@oracle.com,
christian.koenig@amd.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH 1/2] mm: vmalloc: implement vrealloc()
Date: Wed, 17 Jul 2024 20:16:29 -0700 [thread overview]
Message-ID: <ZpiJDdqhDlAb8n6T@infradead.org> (raw)
In-Reply-To: <20240717222427.2211-2-dakr@kernel.org>
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.
next prev parent reply other threads:[~2024-07-18 3:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-17 22:24 [PATCH 0/2] Align kvrealloc() with krealloc() Danilo Krummrich
2024-07-17 22:24 ` [PATCH 1/2] mm: vmalloc: implement vrealloc() Danilo Krummrich
2024-07-18 3:16 ` Christoph Hellwig [this message]
2024-07-18 11:43 ` Danilo Krummrich
2024-07-23 11:28 ` Uladzislau Rezki
2024-07-23 13:44 ` Christoph Hellwig
2024-07-23 15:54 ` Uladzislau Rezki
2024-07-17 22:24 ` [PATCH 2/2] mm: kvmalloc: align kvrealloc() with krealloc() Danilo Krummrich
2024-07-18 3:19 ` Christoph Hellwig
2024-07-18 11:45 ` 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=ZpiJDdqhDlAb8n6T@infradead.org \
--to=hch@infradead.org \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chandan.babu@oracle.com \
--cc=christian.koenig@amd.com \
--cc=cl@linux.com \
--cc=dakr@kernel.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=ojeda@kernel.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=urezki@gmail.com \
--cc=vbabka@suse.cz \
--cc=wedsonaf@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).