[PATCH 2/2] slub: continue to seek slab in node partial if met a null page

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

 



In the per cpu partial slub, we may add a full page into node partial
list. like the following scenario:

	cpu1     		        	cpu2 
    in unfreeze_partials	           in __slab_alloc
	...
   add_partial(n, page, 1);
					alloced from cpu partial, and 
					set frozen = 1.
   second cmpxchg_double_slab()
   set frozen = 0

If it happen, we'd better to skip the full page and to seek next slab in
node partial instead of jump to other nodes.

This patch base on 'slub/partial' head of penberg's tree, and following
code optimize of get_partial_node() patch. 

Signed-off-by: Alex Shi <alex.shi@xxxxxxxxx>
---
 mm/slub.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 8f68757..6fca71c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1616,7 +1616,7 @@ static void *get_partial_node(struct kmem_cache *s,
 		int available;
 
 		if (!t)
-			break;
+			continue;
 
 		if (!object) {
 			c->page = page;
-- 
1.7.0



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


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