Re: [RFC 05/26] mm, slub: extract get_partial() from new_slab_objects()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux