Re: [RFC 05/26] mm, slub: extract get_partial() from new_slab_objects()
From: Mel Gorman
Date: Tue May 25 2021 - 07:54:57 EST
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@xxxxxxx>
> <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