linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Andrey Konovalov" <andreyknvl@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Alexander Potapenko <glider@google.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	<linux-mm@kvack.org>, <kasan-dev@googlegroups.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 -next 1/2] mm/slb: add is_kmalloc_cache() helper function
Date: Thu, 24 Nov 2022 09:21:09 +0800	[thread overview]
Message-ID: <Y37HBTKnLVT03H5y@feng-clx> (raw)
In-Reply-To: <bdafa84a-e5db-471b-fdb2-34ecbf09c225@suse.cz>

On Wed, Nov 23, 2022 at 06:03:26PM +0100, Vlastimil Babka wrote:
> Subject should say mm/slab

My bad, thanks for catching this.

> On 11/23/22 13:31, Feng Tang wrote:
> > commit 6edf2576a6cc ("mm/slub: enable debugging memory wasting of
> > kmalloc") introduces 'SLAB_KMALLOC' bit specifying whether a
> > kmem_cache is a kmalloc cache for slab/slub (slob doesn't have
> > dedicated kmalloc caches).
> > 
> > Add a helper inline function for other components like kasan to
> > simplify code.
> > 
> > Signed-off-by: Feng Tang <feng.tang@intel.com>
> 
> Acked-by: Vlastimil Babka <vbabka@suse.cz>

Thanks!

> Patch 2 seems to depend on patches in Andrew's tree so it's simpler if he
> takes both of these too.

Yes, patch 2/2 change many places of kasan code.

Hi Andrew,

Could you consider taking these 2 patches to your tree? If you think
it's too close to the merge windown, I can respin after 6.2. thanks!

- Feng

> Thanks,
> Vlastimil
> 
> > ---
> > changlog:
> >   
> >   since v1:
> >   * don't use macro for the helper (Andrew Morton)
> >   * place the inline function in mm/slb.h to solve data structure
> >     definition issue (Vlastimil Babka)
> > 
> >  mm/slab.h | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/mm/slab.h b/mm/slab.h
> > index e3b3231af742..0d72fd62751a 100644
> > --- a/mm/slab.h
> > +++ b/mm/slab.h
> > @@ -325,6 +325,14 @@ static inline slab_flags_t kmem_cache_flags(unsigned int object_size,
> >  }
> >  #endif
> >  
> > +static inline bool is_kmalloc_cache(struct kmem_cache *s)
> > +{
> > +#ifndef CONFIG_SLOB
> > +	return (s->flags & SLAB_KMALLOC);
> > +#else
> > +	return false;
> > +#endif
> > +}
> >  
> >  /* Legal flag mask for kmem_cache_create(), for various configurations */
> >  #define SLAB_CORE_FLAGS (SLAB_HWCACHE_ALIGN | SLAB_CACHE_DMA | \
> 


  reply	other threads:[~2022-11-24  1:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 12:31 [PATCH v2 -next 1/2] mm/slb: add is_kmalloc_cache() helper function Feng Tang
2022-11-23 12:31 ` [PATCH v2 -next 2/2] mm/kasan: simplify and refine kasan_cache code Feng Tang
2022-11-23 13:08   ` Andrey Konovalov
2022-11-23 17:03 ` [PATCH v2 -next 1/2] mm/slb: add is_kmalloc_cache() helper function Vlastimil Babka
2022-11-24  1:21   ` Feng Tang [this message]
2022-11-24 10:57 ` Hyeonggon Yoo

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=Y37HBTKnLVT03H5y@feng-clx \
    --to=feng.tang@intel.com \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=cl@linux.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=kasan-dev@googlegroups.com \
    --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=ryabinin.a.a@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=vincenzo.frascino@arm.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).