linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slub: try to get cpu partial slab even if we get enough objects for cpu freelist
@ 2012-08-15 15:38 Joonsoo Kim
  2012-08-15 15:45 ` Christoph Lameter
  0 siblings, 1 reply; 10+ messages in thread
From: Joonsoo Kim @ 2012-08-15 15:38 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: linux-kernel, linux-mm, Joonsoo Kim, Christoph Lameter, David Rientjes

s->cpu_partial determine the maximum number of objects kept
in the per cpu partial lists of a processor. Currently, it is used for
not only per cpu partial list but also cpu freelist. Therefore
get_partial_node() doesn't work properly according to our first intention.

Fix it as forcibly assigning 0 to objects count when we get for cpu freelist.

Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>

diff --git a/mm/slub.c b/mm/slub.c
index efce427..88dca1d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1550,7 +1550,12 @@ static void *get_partial_node(struct kmem_cache *s,
 			c->page = page;
 			stat(s, ALLOC_FROM_PARTIAL);
 			object = t;
-			available =  page->objects - page->inuse;
+
+			/*
+			 * We don't want to stop without trying to get
+			 * cpu partial slab. So, forcibly set 0 to available
+			 */
+			available = 0;
 		} else {
 			available = put_cpu_partial(s, page, 0);
 			stat(s, CPU_PARTIAL_NODE);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-08-17 14:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-15 15:38 [PATCH] slub: try to get cpu partial slab even if we get enough objects for cpu freelist Joonsoo Kim
2012-08-15 15:45 ` Christoph Lameter
2012-08-15 16:35   ` JoonSoo Kim
2012-08-15 17:32     ` Christoph Lameter
2012-08-16 13:47       ` JoonSoo Kim
2012-08-16 17:08         ` Christoph Lameter
2012-08-17 13:34           ` JoonSoo Kim
2012-08-17 14:02             ` Christoph Lameter
2012-08-17 14:37               ` JoonSoo Kim
2012-08-17 14:56                 ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).