Thread (53 messages) 53 messages, 4 authors, 2021-06-09

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

From: Mel Gorman <hidden>
Date: 2021-05-25 11:54:58
Also in: lkml

On Tue, May 25, 2021 at 01:39:25AM +0200, Vlastimil Babka wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
<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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help