From: Suren Baghdasaryan <surenb@google.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: akpm@linux-foundation.org, kent.overstreet@linux.dev,
pasha.tatashin@soleen.com, souravpanda@google.com,
keescook@chromium.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH 1/1] mm/slab: fix 'variable obj_exts set but not used' warning
Date: Tue, 2 Jul 2024 18:58:05 -0700 [thread overview]
Message-ID: <CAJuCfpG5R54jOq1psZKY5FKLKZNnVGCqo2bkyT3v=GX_ikozVw@mail.gmail.com> (raw)
In-Reply-To: <CAJuCfpGr237=zQb58Zd6E-NmpBfvq-6_LQ58nsiwgx9S1KE0pQ@mail.gmail.com>
On Tue, Jul 2, 2024 at 8:16 AM Suren Baghdasaryan <surenb@google.com> wrote:
>
> On Tue, Jul 2, 2024 at 9:31 AM Vlastimil Babka <vbabka@suse.cz> wrote:
> >
> > On 6/30/24 9:20 PM, Suren Baghdasaryan wrote:
> > > On Mon, Jun 17, 2024 at 3:04 AM Vlastimil Babka <vbabka@suse.cz> wrote:
> > >>
> > >> On 6/15/24 12:59 AM, Suren Baghdasaryan wrote:
> > >> > slab_post_alloc_hook() uses prepare_slab_obj_exts_hook() to obtain
> > >> > slabobj_ext object. Currently the only user of slabobj_ext object in
> > >> > this path is memory allocation profiling, therefore when it's not enabled
> > >> > this object is not needed. This also generates a warning when compiling
> > >> > with CONFIG_MEM_ALLOC_PROFILING=n. Move the code under this configuration
> > >> > to fix the warning. If more slabobj_ext users appear in the future, the
> > >> > code will have to be changed back to call prepare_slab_obj_exts_hook().
> > >> >
> > >> > Fixes: 4b8736964640 ("mm/slab: add allocation accounting into slab allocation and free paths")
> > >> > Reported-by: kernel test robot <lkp@intel.com>
> > >> > Closes: https://lore.kernel.org/oe-kbuild-all/202406150444.F6neSaiy-lkp@intel.com/
> > >> > Signed-off-by: Suren Baghdasaryan <surenb@google.com>
> > >>
> > >> Acked-by: Vlastimil Babka <vbabka@suse.cz>
> > >>
> > >> But it seems to me we could remove the whole #ifdef if current->alloc_tag
> > >> (which doesn't exist with !MEM_ALLOC_PROFILING) had an access helper, or
> > >> there was a alloc_tag_add_current() variant?
> > >
> > > Hmm. I'll check if current->alloc_tag is the only reason for this
> > > ifdef. If so then you are correct and we can simplify this code.
> >
> > The fix is now in mm-hotfixes-stable but we can cleanup for the future as a
> > non-hotfix.
>
> Yes, it's on my TODO list now. Thanks!
obj_exts->ref was also undefined when !MEM_ALLOC_PROFILING, so I moved
that call into a separate hook. It's posted at
https://lore.kernel.org/all/20240703015354.3370503-1-surenb@google.com/
Thanks,
Suren.
>
> >
prev parent reply other threads:[~2024-07-03 1:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 22:59 Suren Baghdasaryan
2024-06-17 10:04 ` Vlastimil Babka
2024-06-30 19:20 ` Suren Baghdasaryan
2024-07-02 9:31 ` Vlastimil Babka
2024-07-02 15:16 ` Suren Baghdasaryan
2024-07-03 1:58 ` Suren Baghdasaryan [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='CAJuCfpG5R54jOq1psZKY5FKLKZNnVGCqo2bkyT3v=GX_ikozVw@mail.gmail.com' \
--to=surenb@google.com \
--cc=akpm@linux-foundation.org \
--cc=keescook@chromium.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=pasha.tatashin@soleen.com \
--cc=souravpanda@google.com \
--cc=vbabka@suse.cz \
/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