login
Header Space

 
 

[patch 08/21] slub: add defrag statistics

Previous thread: [patch 17/21] Filesystem: Slab defrag: Reiserfs support by Christoph Lameter on Friday, May 9, 2008 - 11:08 pm. (1 message)

Next thread: [patch 15/21] Filesystem: XFS slab defragmentation by Christoph Lameter on Friday, May 9, 2008 - 11:08 pm. (2 messages)
To: <akpm@...>
Cc: <linux-kernel@...>, Pekka Enberg <penberg@...>, <linux-fsdevel@...>, Mel Gorman <mel@...>, <andi@...>, Rik van Riel <riel@...>, <mpm@...>
Date: Friday, May 9, 2008 - 11:08 pm

Add statistics counters for slab defragmentation.

Signed-off-by: Christoph Lameter &lt;clameter@sgi.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
---
 Documentation/vm/slabinfo.c |   45 ++++++++++++++++++++++++++++++++++++--------
 include/linux/slub_def.h    |    6 +++++
 mm/slub.c                   |   29 ++++++++++++++++++++++++++--
 3 files changed, 70 insertions(+), 10 deletions(-)

Index: linux-2.6/Documentation/vm/slabinfo.c
===================================================================
--- linux-2.6.orig/Documentation/vm/slabinfo.c	2008-05-07 21:23:04.902660104 -0700
+++ linux-2.6/Documentation/vm/slabinfo.c	2008-05-07 21:23:05.432658246 -0700
@@ -41,6 +41,9 @@ struct slabinfo {
 	unsigned long cpuslab_flush, deactivate_full, deactivate_empty;
 	unsigned long deactivate_to_head, deactivate_to_tail;
 	unsigned long deactivate_remote_frees, order_fallback;
+	unsigned long shrink_calls, shrink_attempt_defrag, shrink_empty_slab;
+	unsigned long shrink_slab_skipped, shrink_slab_reclaimed;
+	unsigned long shrink_object_reclaim_failed;
 	int numa[MAX_NODES];
 	int numa_partial[MAX_NODES];
 } slabinfo[MAX_SLABS];
@@ -79,6 +82,7 @@ int sort_active = 0;
 int set_debug = 0;
 int show_ops = 0;
 int show_activity = 0;
+int show_defragcount = 0;
 
 /* Debug options */
 int sanity = 0;
@@ -113,6 +117,7 @@ void usage(void)
 		"-e|--empty             Show empty slabs\n"
 		"-f|--first-alias       Show first alias\n"
 		"-F|--defrag            Show defragmentable caches\n"
+		"-G:--display-defrag    Display defrag counters\n"
 		"-h|--help              Show usage information\n"
 		"-i|--inverted          Inverted list\n"
 		"-l|--slabs             Show slabs\n"
@@ -300,6 +305,8 @@ void first_line(void)
 {
 	if (show_activity)
 		printf("Name                   Objects      Alloc       Free   %%Fast Fallb O\n");
+	else if (show_defragcount)
+		printf("Name                   Objects DefragRQ  Slabs Success   Empty Skipped  Failed\n");
 	else
 		printf("...
Previous thread: [patch 17/21] Filesystem: Slab defrag: Reiserfs support by Christoph Lameter on Friday, May 9, 2008 - 11:08 pm. (1 message)

Next thread: [patch 15/21] Filesystem: XFS slab defragmentation by Christoph Lameter on Friday, May 9, 2008 - 11:08 pm. (2 messages)
speck-geostationary