From: Danilo Krummrich <dakr@kernel.org>
To: Christoph Hellwig <hch@infradead.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, 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 2/2] mm: kvmalloc: align kvrealloc() with krealloc()
Date: Thu, 18 Jul 2024 13:45:11 +0200 [thread overview]
Message-ID: <ZpkARwEkp70YMVzf@pollux> (raw)
In-Reply-To: <ZpiJvj1_rKodpVSt@infradead.org>
On Wed, Jul 17, 2024 at 08:19:26PM -0700, Christoph Hellwig wrote:
> > +extern void *kvrealloc_noprof(const void *p, size_t size, gfp_t flags) __realloc_size(2);
>
> Please drop the extern while you're at it and move the __realloc_size
> attribute to a separate line.
Will do.
>
> > +static gfp_t to_kmalloc_flags(gfp_t flags, size_t size)
> > +{
> > + if (size > PAGE_SIZE) {
> > + flags |= __GFP_NOWARN;
> > +
> > + if (!(flags & __GFP_RETRY_MAYFAIL))
> > + flags |= __GFP_NORETRY;
> > +
> > + /* nofail semantic is implemented by the vmalloc fallback */
> > + flags &= ~__GFP_NOFAIL;
> > + }
> > +
> > + return flags;
>
> The name for this function sounds a bit odd. Maybe kmalloc_gfp_adjust
> instead? Also the comment explaining these flags tweaks should move
> from the caller to this function.
kmalloc_gfp_adjust() sounds good to me. I will rename it and move the comment
up.
prev parent reply other threads:[~2024-07-18 11:45 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
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 [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=ZpkARwEkp70YMVzf@pollux \
--to=dakr@kernel.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=hch@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.