linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux-foundation.org>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: akpm@linux-foundation.org, Christoph Lameter <clameter@sgi.com>,
	Christoph Lameter <cl@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Cc: Mel Gorman <mel@skynet.ie>
Cc: andi@firstfloor.org
Cc: Rik van Riel <riel@redhat.com>
Cc: mpm@selenic.com
Cc: Dave Chinner <david@fromorbit.com>
Subject: [patch 07/19] slub: Extend slabinfo to support -D and -F options
Date: Fri, 09 May 2008 19:21:08 -0700	[thread overview]
Message-ID: <20080801182345.521105016@lameter.com> (raw)
In-Reply-To: 20080801182324.572058187@lameter.com

[-- Attachment #1: 0007-SLUB-Extend-slabinfo-to-support-D-and-F-options.patch --]
[-- Type: text/plain, Size: 5707 bytes --]

-F lists caches that support defragmentation

-C lists caches that use a ctor.

Change field names for defrag_ratio and remote_node_defrag_ratio.

Add determination of the allocation ratio for a slab. The allocation ratio
is the percentage of available slots for objects in use.

Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>

---
 Documentation/vm/slabinfo.c |   48 +++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 43 insertions(+), 5 deletions(-)

Index: linux-next/Documentation/vm/slabinfo.c
===================================================================
--- linux-next.orig/Documentation/vm/slabinfo.c	2008-07-09 09:06:12.000000000 -0500
+++ linux-next/Documentation/vm/slabinfo.c	2008-07-09 09:33:37.000000000 -0500
@@ -31,6 +31,8 @@
 	int hwcache_align, object_size, objs_per_slab;
 	int sanity_checks, slab_size, store_user, trace;
 	int order, poison, reclaim_account, red_zone;
+	int defrag, ctor;
+	int defrag_ratio, remote_node_defrag_ratio;
 	unsigned long partial, objects, slabs, objects_partial, objects_total;
 	unsigned long alloc_fastpath, alloc_slowpath;
 	unsigned long free_fastpath, free_slowpath;
@@ -64,6 +66,8 @@
 int skip_zero = 1;
 int show_numa = 0;
 int show_track = 0;
+int show_defrag = 0;
+int show_ctor = 0;
 int show_first_alias = 0;
 int validate = 0;
 int shrink = 0;
@@ -100,13 +104,15 @@
 void usage(void)
 {
 	printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n"
-		"slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n"
+		"slabinfo [-aCdDefFhnpvtsz] [-d debugopts] [slab-regexp]\n"
 		"-a|--aliases           Show aliases\n"
 		"-A|--activity          Most active slabs first\n"
 		"-d<options>|--debug=<options> Set/Clear Debug options\n"
+		"-C|--ctor              Show slabs with ctors\n"
 		"-D|--display-active    Switch line format to activity\n"
 		"-e|--empty             Show empty slabs\n"
 		"-f|--first-alias       Show first alias\n"
+		"-F|--defrag            Show defragmentable caches\n"
 		"-h|--help              Show usage information\n"
 		"-i|--inverted          Inverted list\n"
 		"-l|--slabs             Show slabs\n"
@@ -296,7 +302,7 @@
 		printf("Name                   Objects      Alloc       Free   %%Fast Fallb O\n");
 	else
 		printf("Name                   Objects Objsize    Space "
-			"Slabs/Part/Cpu  O/S O %%Fr %%Ef Flg\n");
+			"Slabs/Part/Cpu  O/S O %%Ra %%Ef Flg\n");
 }
 
 /*
@@ -345,7 +351,7 @@
 		return;
 
 	if (!line) {
-		printf("\n%-21s:", mode ? "NUMA nodes" : "Slab");
+		printf("\n%-21s: Rto ", mode ? "NUMA nodes" : "Slab");
 		for(node = 0; node <= highest_node; node++)
 			printf(" %4d", node);
 		printf("\n----------------------");
@@ -354,6 +360,7 @@
 		printf("\n");
 	}
 	printf("%-21s ", mode ? "All slabs" : s->name);
+	printf("%3d ", s->remote_node_defrag_ratio);
 	for(node = 0; node <= highest_node; node++) {
 		char b[20];
 
@@ -492,6 +499,8 @@
 		printf("** Slabs are destroyed via RCU\n");
 	if (s->reclaim_account)
 		printf("** Reclaim accounting active\n");
+	if (s->defrag)
+		printf("** Defragmentation at %d%%\n", s->defrag_ratio);
 
 	printf("\nSizes (bytes)     Slabs              Debug                Memory\n");
 	printf("------------------------------------------------------------------------\n");
@@ -539,6 +548,12 @@
 	if (show_empty && s->slabs)
 		return;
 
+	if (show_defrag && !s->defrag)
+		return;
+
+	if (show_ctor && !s->ctor)
+		return;
+
 	store_size(size_str, slab_size(s));
 	snprintf(dist_str, 40, "%lu/%lu/%d", s->slabs - s->cpu_slabs,
 						s->partial, s->cpu_slabs);
@@ -550,6 +565,10 @@
 		*p++ = '*';
 	if (s->cache_dma)
 		*p++ = 'd';
+	if (s->defrag)
+		*p++ = 'F';
+	if (s->ctor)
+		*p++ = 'C';
 	if (s->hwcache_align)
 		*p++ = 'A';
 	if (s->poison)
@@ -584,7 +603,8 @@
 		printf("%-21s %8ld %7d %8s %14s %4d %1d %3ld %3ld %s\n",
 			s->name, s->objects, s->object_size, size_str, dist_str,
 			s->objs_per_slab, s->order,
-			s->slabs ? (s->partial * 100) / s->slabs : 100,
+			s->slabs ? (s->partial * 100) /
+					(s->slabs * s->objs_per_slab) : 100,
 			s->slabs ? (s->objects * s->object_size * 100) /
 				(s->slabs * (page_size << s->order)) : 100,
 			flags);
@@ -1190,7 +1210,17 @@
 			slab->deactivate_to_tail = get_obj("deactivate_to_tail");
 			slab->deactivate_remote_frees = get_obj("deactivate_remote_frees");
 			slab->order_fallback = get_obj("order_fallback");
+			slab->defrag_ratio = get_obj("defrag_ratio");
+			slab->remote_node_defrag_ratio =
+					get_obj("remote_node_defrag_ratio");
 			chdir("..");
+			if (read_slab_obj(slab, "ops")) {
+				if (strstr(buffer, "ctor :"))
+					slab->ctor = 1;
+				if (strstr(buffer, "kick :"))
+					slab->defrag = 1;
+			}
+
 			if (slab->name[0] == ':')
 				alias_targets++;
 			slab++;
@@ -1241,10 +1271,12 @@
 struct option opts[] = {
 	{ "aliases", 0, NULL, 'a' },
 	{ "activity", 0, NULL, 'A' },
+	{ "ctor", 0, NULL, 'C' },
 	{ "debug", 2, NULL, 'd' },
 	{ "display-activity", 0, NULL, 'D' },
 	{ "empty", 0, NULL, 'e' },
 	{ "first-alias", 0, NULL, 'f' },
+	{ "defrag", 0, NULL, 'F' },
 	{ "help", 0, NULL, 'h' },
 	{ "inverted", 0, NULL, 'i'},
 	{ "numa", 0, NULL, 'n' },
@@ -1267,7 +1299,7 @@
 
 	page_size = getpagesize();
 
-	while ((c = getopt_long(argc, argv, "aAd::Defhil1noprstvzTS",
+	while ((c = getopt_long(argc, argv, "aACd::DefFhil1noprstvzTS",
 						opts, NULL)) != -1)
 		switch (c) {
 		case '1':
@@ -1323,6 +1355,12 @@
 		case 'z':
 			skip_zero = 0;
 			break;
+		case 'C':
+			show_ctor = 1;
+			break;
+		case 'F':
+			show_defrag = 1;
+			break;
 		case 'T':
 			show_totals = 1;
 			break;

-- 

  parent reply	other threads:[~2008-08-01 18:37 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-10  2:21 [patch 00/19] Slab Fragmentation Reduction V13 Christoph Lameter
2008-05-10  2:21 ` [patch 01/19] slub: Add defrag_ratio field and sysfs support Christoph Lameter
2008-05-10  2:21 ` [patch 02/19] slub: Replace ctor field with ops field in /sys/slab/* Christoph Lameter
2008-05-10  2:21 ` [patch 03/19] slub: Add get() and kick() methods Christoph Lameter
2008-05-10  2:21 ` [patch 04/19] slub: Sort slab cache list and establish maximum objects for defrag slabs Christoph Lameter
2008-05-10  2:21 ` [patch 05/19] slub: Slab defrag core Christoph Lameter
2008-05-10  2:21 ` [patch 06/19] slub: Add KICKABLE to avoid repeated kick() attempts Christoph Lameter
2008-05-10  2:21 ` Christoph Lameter [this message]
2008-05-10  2:21 ` [patch 08/19] slub/slabinfo: add defrag statistics Christoph Lameter
2008-05-10  2:21 ` [patch 09/19] slub: Trigger defragmentation from memory reclaim Christoph Lameter
2008-05-10  2:21 ` [patch 10/19] buffer heads: Support slab defrag Christoph Lameter
2008-05-10  2:21 ` [patch 11/19] inodes: Support generic defragmentation Christoph Lameter
2008-05-10  2:21 ` [patch 12/19] Filesystem: Ext2 filesystem defrag Christoph Lameter
2008-05-10  2:21 ` [patch 13/19] Filesystem: Ext3 " Christoph Lameter
2008-05-10  2:21 ` [patch 14/19] Filesystem: Ext4 " Christoph Lameter
2008-08-03  1:54   ` Theodore Tso
2008-08-13  7:26     ` Pekka Enberg
2008-05-10  2:21 ` [patch 15/19] Filesystem: XFS slab defragmentation Christoph Lameter
2008-08-03  1:42   ` Dave Chinner
2008-08-04 13:36     ` Christoph Lameter
2008-05-10  2:21 ` [patch 16/19] Filesystem: /proc filesystem support for slab defrag Christoph Lameter
2008-05-10  2:21 ` [patch 17/19] Filesystem: Slab defrag: Reiserfs support Christoph Lameter
2008-05-10  2:21 ` [patch 18/19] dentries: Add constructor Christoph Lameter
2008-05-10  2:21 ` [patch 19/19] dentries: dentry defragmentation Christoph Lameter
2008-08-03  1:58 ` No, really, stop trying to delete slab until you've finished making slub perform as well Matthew Wilcox
2008-08-03 21:25   ` Pekka Enberg
2008-08-04  2:37     ` Rene Herman
2008-08-04 21:22       ` Pekka Enberg
2008-08-04 21:41         ` Christoph Lameter
2008-08-04 23:09           ` Rene Herman
2008-08-04 13:43   ` Christoph Lameter
2008-08-04 14:48     ` Jamie Lokier
2008-08-04 15:21       ` Jamie Lokier
2008-08-04 16:35         ` Christoph Lameter
2008-08-04 15:11     ` Rik van Riel
2008-08-04 16:02       ` Christoph Lameter
2008-08-04 16:47     ` KOSAKI Motohiro
2008-08-04 17:13       ` Christoph Lameter
2008-08-04 17:20         ` Pekka Enberg
2008-08-05 12:06         ` KOSAKI Motohiro
2008-08-05 14:59           ` Christoph Lameter
2008-08-06 12:36             ` KOSAKI Motohiro
2008-08-06 14:24               ` Christoph Lameter
2008-08-13 10:46             ` KOSAKI Motohiro
2008-08-13 13:10               ` Christoph Lameter
2008-08-13 14:14                 ` KOSAKI Motohiro
2008-08-13 14:16                   ` Pekka Enberg
2008-08-13 14:31                   ` Christoph Lameter
2008-08-13 15:05                     ` KOSAKI Motohiro
2008-08-14 19:44                       ` Christoph Lameter
2008-08-15 16:44                         ` KOSAKI Motohiro
2008-08-15 18:24                           ` Christoph Lameter
2008-08-15 19:42                             ` Christoph Lameter
2008-08-18 10:08                               ` KOSAKI Motohiro
2008-08-18 10:34                                 ` KOSAKI Motohiro
2008-08-18 14:08                                   ` Christoph Lameter
2008-08-19 10:34                                     ` KOSAKI Motohiro
2008-08-19 13:51                                       ` Christoph Lameter
2008-08-20 11:46                                         ` KOSAKI Motohiro
2008-08-14  7:15                 ` Pekka Enberg
2008-08-14 14:45                   ` Christoph Lameter
2008-08-14 15:06                   ` Christoph Lameter
2008-08-04 17:19       ` Christoph Lameter
  -- strict thread matches above, loose matches on Subject: below --
2008-08-11 15:06 [patch 00/19] Slab Fragmentation Reduction V14 Christoph Lameter
2008-08-11 15:06 ` [patch 07/19] slub: Extend slabinfo to support -D and -F options Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080801182345.521105016@lameter.com \
    --to=cl@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=penberg@cs.helsinki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).