lkml.org 
[lkml]   [2021]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 05/26] mm, slub: extract get_partial() from new_slab_objects()
On Tue, May 25, 2021 at 01:39:25AM +0200, Vlastimil Babka wrote:
> The later patches will need more fine grained control over individual actions
> in ___slab_alloc(), the only caller of new_slab_objects(), so this is a first
> preparatory step with no functional change.
>
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> <SNIP>
> @@ -2748,6 +2743,10 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
> goto redo;
> }
>
> + freelist = get_partial(s, gfpflags, node, c);
> + if (freelist)
> + goto check_new_page;
> +
> freelist = new_slab_objects(s, gfpflags, node, &c);
>
> if (unlikely(!freelist)) {

It's a nit-pick, but why did you not simply do something like this
instead of the goto?

freelist = get_partial(s, gfpflags, node, c);
if (!freelist)
freelist = new_slab_objects(s, gfpflags, node, &c);

if (unlikely(!freelist))
...

If nothing else, the label may be misleading because c->page may not
be new.

--
Mel Gorman
SUSE Labs

\
 
 \ /
  Last update: 2021-05-25 13:55    [W:0.292 / U:1.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site