Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-24 Thread Vlastimil Babka
On 6/18/20 12:10 PM, Vlastimil Babka wrote: > 8< > From b8df607d92b37e5329ce7bda62b2b364cc249893 Mon Sep 17 00:00:00 2001 > From: Vlastimil Babka > Date: Thu, 18 Jun 2020 11:52:03 +0200 > Subject: [PATCH] mm, slab/slub: improve error reporting and overhead of > cache_from_obj() >

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-19 Thread Kees Cook
On Thu, Jun 18, 2020 at 01:05:53PM -0700, Roman Gushchin wrote: > On Thu, Jun 18, 2020 at 12:10:38PM +0200, Vlastimil Babka wrote: > > To prvent the churn of your patch moving the cache_from_obj() back to > > slab.h, I > > think it's best if we modify my patch. The patch below should be squashed

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-18 Thread Roman Gushchin
On Thu, Jun 18, 2020 at 12:10:38PM +0200, Vlastimil Babka wrote: > > On 6/17/20 7:49 PM, Kees Cook wrote: > > On Wed, Jun 10, 2020 at 06:31:35PM +0200, Vlastimil Babka wrote: > >> The function cache_from_obj() was added by commit b9ce5ef49f00 ("sl[au]b: > >> always get the cache from its page in

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-18 Thread Kees Cook
On Thu, Jun 18, 2020 at 12:10:38PM +0200, Vlastimil Babka wrote: > > On 6/17/20 7:49 PM, Kees Cook wrote: > > On Wed, Jun 10, 2020 at 06:31:35PM +0200, Vlastimil Babka wrote: > >> The function cache_from_obj() was added by commit b9ce5ef49f00 ("sl[au]b: > >> always get the cache from its page in

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-18 Thread Vlastimil Babka
On 6/17/20 7:49 PM, Kees Cook wrote: > On Wed, Jun 10, 2020 at 06:31:35PM +0200, Vlastimil Babka wrote: >> The function cache_from_obj() was added by commit b9ce5ef49f00 ("sl[au]b: >> always get the cache from its page in kmem_cache_free()") to support kmemcg, >> where per-memcg cache can be

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-17 Thread Kees Cook
On Wed, Jun 10, 2020 at 06:31:35PM +0200, Vlastimil Babka wrote: > The function cache_from_obj() was added by commit b9ce5ef49f00 ("sl[au]b: > always get the cache from its page in kmem_cache_free()") to support kmemcg, > where per-memcg cache can be different from the root one, so we can't use >

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-11 Thread Roman Gushchin
On Thu, Jun 11, 2020 at 11:56:53AM +0200, Vlastimil Babka wrote: > On 6/11/20 12:46 AM, Roman Gushchin wrote: > > On Wed, Jun 10, 2020 at 06:31:35PM +0200, Vlastimil Babka wrote: > >> @@ -3672,6 +3672,14 @@ void *__kmalloc_track_caller(size_t size, gfp_t > >> flags, unsigned long caller) > >> }

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-11 Thread Vlastimil Babka
On 6/11/20 12:46 AM, Roman Gushchin wrote: > On Wed, Jun 10, 2020 at 06:31:35PM +0200, Vlastimil Babka wrote: >> @@ -3672,6 +3672,14 @@ void *__kmalloc_track_caller(size_t size, gfp_t >> flags, unsigned long caller) >> } >> EXPORT_SYMBOL(__kmalloc_track_caller); >> >> +static inline struct

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-10 Thread Roman Gushchin
On Wed, Jun 10, 2020 at 06:31:35PM +0200, Vlastimil Babka wrote: > The function cache_from_obj() was added by commit b9ce5ef49f00 ("sl[au]b: > always get the cache from its page in kmem_cache_free()") to support kmemcg, > where per-memcg cache can be different from the root one, so we can't use >

[PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-10 Thread Vlastimil Babka
The function cache_from_obj() was added by commit b9ce5ef49f00 ("sl[au]b: always get the cache from its page in kmem_cache_free()") to support kmemcg, where per-memcg cache can be different from the root one, so we can't use the kmem_cache pointer given to kmem_cache_free(). Prior to that commit,