[patch] mm: pcp stats

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

 



Following patch offers some stats about pageset activity.

Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/mm/page_alloc.c
@@ -720,6 +720,7 @@ static void fastcall free_hot_cold_page(
 	pset = zone_pcp(zone, get_cpu());
 	local_irq_save(flags);
 	__inc_page_state(pgfree);
+	__inc_page_state(pcpfree);
 	pset->count++;
 	if (cold) {
 		pset->cold_count++;
@@ -733,6 +734,7 @@ static void fastcall free_hot_cold_page(
 		free_pages_bulk(zone, count, &pset->list, 0);
 		pset->cold_count -= min(count, pset->cold_count);
 		pset->count -= count;
+		__mod_page_state(pcpspill, count);
 	}
 	local_irq_restore(flags);
 	put_cpu();
@@ -794,8 +796,10 @@ again:
 				goto failed;
 			pset->count += count;
 			pset->cold_count += count;
+			__mod_page_state(pcpfill, count);
 		}
 
+		__inc_page_state(pcpalloc);
 		pset->count--;
 		if (cold) {
 			page = list_entry(pset->list.prev, struct page, lru);
@@ -2319,6 +2323,10 @@ static char *vmstat_text[] = {
 	"pgalloc_dma",
 
 	"pgfree",
+	"pcpalloc",
+	"pcpfree",
+	"pcpfill",
+	"pcpspill",
 	"pgactivate",
 	"pgdeactivate",
 
Index: linux-2.6/include/linux/page-flags.h
===================================================================
--- linux-2.6.orig/include/linux/page-flags.h
+++ linux-2.6/include/linux/page-flags.h
@@ -117,6 +117,10 @@ struct page_state {
 	unsigned long pgalloc_dma;
 
 	unsigned long pgfree;		/* page freeings */
+	unsigned long pcpalloc;		/* pages allocated from pcp lists */
+	unsigned long pcpfree;		/* pages freed into pcp lists */
+	unsigned long pcpfill;		/* pages allocated into pcp lists */
+	unsigned long pcpspill;		/* pages freed from pcp lists */
 	unsigned long pgactivate;	/* pages moved inactive->active */
 	unsigned long pgdeactivate;	/* pages moved active->inactive */
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux