Re: [PATCH] slub: Don't throw away partial remote slabs if there is no local memory

2 messages, 2 authors, 2014-01-08 · open the first message on its own page

Re: [PATCH] slub: Don't throw away partial remote slabs if there is no local memory

From: Andi Kleen <hidden>
Date: 2014-01-07 06:50:04

Anton Blanchard [off-list ref] writes:
Thoughts? It seems like we could hit a similar situation if a machine
is balanced but we run out of memory on a single node.
Yes I agree, but your patch doesn't seem to attempt to handle this?

-Andi
quoted hunk
Index: b/mm/slub.c
===================================================================
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2278,10 +2278,17 @@ redo:
 
 	if (unlikely(!node_match(page, node))) {
 		stat(s, ALLOC_NODE_MISMATCH);
-		deactivate_slab(s, page, c->freelist);
-		c->page = NULL;
-		c->freelist = NULL;
-		goto new_slab;
+
+		/*
+		 * If the node contains no memory there is no point in trying
+		 * to allocate a new node local slab
+		 */
+		if (node_spanned_pages(node)) {
+			deactivate_slab(s, page, c->freelist);
+			c->page = NULL;
+			c->freelist = NULL;
+			goto new_slab;
+		}
 	}
 
 	/*
-- 
ak@linux.intel.com -- Speaking for myself only

Re: [PATCH] slub: Don't throw away partial remote slabs if there is no local memory

From: Anton Blanchard <hidden>
Date: 2014-01-08 14:04:21

Hi Andi,
quoted
Thoughts? It seems like we could hit a similar situation if a
machine is balanced but we run out of memory on a single node.
Yes I agree, but your patch doesn't seem to attempt to handle this?
It doesn't. I was hoping someone with more mm knowledge than I could
suggest a lightweight way of doing this.

Anton
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help