Thread (11 messages) 11 messages, 3 authors, 2012-02-20

Re: [rfc PATCH]slub: per cpu partial statistics change

From: Christoph Lameter <hidden>
Date: 2012-02-03 15:27:18
Also in: lkml

On Fri, 3 Feb 2012, Alex,Shi wrote:
This patch split the cpu_partial_free into 2 parts: cpu_partial_node, PCP refilling
times from node partial; and same name cpu_partial_free, PCP refilling times in
slab_free slow path. A new statistic 'release_cpu_partial' is added to get PCP
release times. These info are useful when do PCP tunning.
Releasing? The code where you inserted the new statistics counts the pages
put on the cpu partial list when refilling from the node partial list.

See more below.
quoted hunk ↗ jump to hunk
 struct kmem_cache_cpu {
diff --git a/mm/slub.c b/mm/slub.c
index 4907563..5dd299c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1560,6 +1560,7 @@ static void *get_partial_node(struct kmem_cache *s,
 		} else {
 			page->freelist = t;
 			available = put_cpu_partial(s, page, 0);
+			stat(s, CPU_PARTIAL_NODE);
This is refilling the per cpu partial list from the node list.
quoted hunk ↗ jump to hunk
 		}
 		if (kmem_cache_debug(s) || available > s->cpu_partial / 2)
 			break;
@@ -1973,6 +1974,7 @@ int put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
 				local_irq_restore(flags);
 				pobjects = 0;
 				pages = 0;
+				stat(s, RELEASE_CPU_PARTIAL);
The callers count the cpu partial operations. Why is there now one in
put_cpu_partial? It is moving a page to the cpu partial list. Not
releasing it from the cpu partial list.
quoted hunk ↗ jump to hunk
@@ -2465,9 +2466,10 @@ static void __slab_free(struct kmem_cache *s, struct page *page,
 		 * If we just froze the page then put it onto the
 		 * per cpu partial list.
 		 */
-		if (new.frozen && !was_frozen)
+		if (new.frozen && !was_frozen) {
 			put_cpu_partial(s, page, 1);
-
+			stat(s, CPU_PARTIAL_FREE);
cpu partial list filled with a partial page created from a fully allocated
slab (which therefore was not on any list before).


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  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@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help