From: Dan Carpenter <dan.carpenter@linaro.org>
To: Helge Deller <deller@gmx.de>
Cc: oe-kbuild@lists.linux.dev, Marco Elver <elver@google.com>,
Hyeonggon Yoo <42.hyeyoo@gmail.com>,
lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: mm/kfence/kfence_test.c:287 test_alloc() warn: use 'gfp' here instead of GFP_KERNEL?
Date: Thu, 27 Jul 2023 08:35:48 +0300 [thread overview]
Message-ID: <7f9f8c77-044c-4c20-85ba-3c1ef4e6a358@kadam.mountain> (raw)
In-Reply-To: <fea8677b-348a-dd67-4eac-12c547afa00d@gmx.de>
On Thu, Jul 27, 2023 at 07:23:23AM +0200, Helge Deller wrote:
> > bc8fbc5f305aec Marco Elver 2021-02-25 282 alloc = kmalloc(size, gfp);
> > ^^^
> >
> > bc8fbc5f305aec Marco Elver 2021-02-25 283
> > bc8fbc5f305aec Marco Elver 2021-02-25 284 if (is_kfence_address(alloc)) {
> > 8dae0cfed57357 Vlastimil Babka 2021-11-03 285 struct slab *slab = virt_to_slab(alloc);
> > 588c7fa022d7b2 Hyeonggon Yoo 2021-06-28 286 struct kmem_cache *s = test_cache ?:
> > 588c7fa022d7b2 Hyeonggon Yoo 2021-06-28 @287 kmalloc_caches[kmalloc_type(GFP_KERNEL)][__kmalloc_index(size, false)];
> > ^^^^^^^^^^
> > I feel like using gfp might be correct but I'm not sure? This code
> > is from prior to this commit. Let's add Marco to the CC.
>
> Since this is a test program, I assume that "GFP_KERNEL" is used intentionally
> instead of "gfp" here to check if the "kmalloc(size, gfp)" above gets the right kmalloc_caches[].
> If so, is there a way to silence the smatch warning ("mm/kfence/kfence_test.c:287 test_alloc() warn: use 'gfp' here instead of GFP_KERNEL?") ?
> But I'm not sure either, so adding Hyeonggon to the CC too...
Instead of silencing warnings, I prefer to just look at them one time
and move on.
Old warnings are included in the emails if someone touches the code
again. The other double free warnings are an example of this. (Except
that I never have forwarded them before because they're intentional as
part of testing kfence.)
regards,
dan carpenter
next prev parent reply other threads:[~2023-07-27 5:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 4:51 Dan Carpenter
2023-07-27 5:23 ` Helge Deller
2023-07-27 5:35 ` Dan Carpenter [this message]
2023-07-27 8:06 ` Marco Elver
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=7f9f8c77-044c-4c20-85ba-3c1ef4e6a358@kadam.mountain \
--to=dan.carpenter@linaro.org \
--cc=42.hyeyoo@gmail.com \
--cc=deller@gmx.de \
--cc=elver@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
/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
all inboxes | Powered by JetHome®