linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	 Catalin Marinas <catalin.marinas@arm.com>,
	Christoph Lameter <cl@linux.com>,
	 Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	 Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	 Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH] mm/slub: Avoid recursive loop with kmemleak
Date: Thu, 25 Apr 2024 20:46:13 -0700	[thread overview]
Message-ID: <CAJuCfpGLZ88KMTH93gxfFC++AMCEcObyS1FG_S_w6Ce+koai9A@mail.gmail.com> (raw)
In-Reply-To: <t6iykbzqfwt3d7j537shnvebwqy4u5fmzw2gwyeb6a7cosp3hu@eugiwl3t6zfn>

On Thu, Apr 25, 2024 at 5:19 PM Kent Overstreet
<kent.overstreet@linux.dev> wrote:
>
> On Thu, Apr 25, 2024 at 04:49:17PM -0700, Andrew Morton wrote:
> > On Thu, 25 Apr 2024 14:30:55 -0700 Suren Baghdasaryan <surenb@google.com> wrote:
> >
> > > > > --- a/mm/kmemleak.c
> > > > > +++ b/mm/kmemleak.c
> > > > > @@ -463,7 +463,7 @@ static struct kmemleak_object *mem_pool_alloc(gfp_t gfp)
> > > > >
> > > > >       /* try the slab allocator first */
> > > > >       if (object_cache) {
> > > > > -             object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp));
> > > > > +             object = kmem_cache_alloc_noprof(object_cache, gfp_kmemleak_mask(gfp));
> > > >
> > > > What do these get accounted to, or does this now pop a warning with
> > > > CONFIG_MEM_ALLOC_PROFILING_DEBUG?
> > >
> > > Thanks for the fix, Kees!
> > > I'll look into this recursion more closely to see if there is a better
> > > way to break it. As a stopgap measure seems ok to me. I also think
> > > it's unlikely that one would use both tracking mechanisms on the same
> > > system.
> >
> > I'd really like to start building mm-stable without having to route
> > around memprofiling.  How about I include Kees's patch in that for now?
>
> Agreed

Yes, please. When I figure out a better way, I'll post a separate patch. Thanks!


  reply	other threads:[~2024-04-26  3:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25 20:55 Kees Cook
2024-04-25 21:09 ` Kent Overstreet
2024-04-25 21:30   ` Suren Baghdasaryan
2024-04-25 23:49     ` Andrew Morton
2024-04-26  0:19       ` Kent Overstreet
2024-04-26  3:46         ` Suren Baghdasaryan [this message]
2024-04-26 14:52 ` Catalin Marinas
2024-04-26 17:06   ` Kees Cook

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=CAJuCfpGLZ88KMTH93gxfFC++AMCEcObyS1FG_S_w6Ce+koai9A@mail.gmail.com \
    --to=surenb@google.com \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=keescook@chromium.org \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --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