All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH] make mballoc history a config option
Date: Fri, 01 Feb 2008 14:22:29 -0600	[thread overview]
Message-ID: <47A37F85.1050006@redhat.com> (raw)

mballoc history is likely a great debugging tool, but it seems a
bit heavyweight.  If I make it a config option and turn it off,
things lighten up considerably, from:

220 ext4_mb_free_blocks
188 ext4_mb_seq_groups_show
176 ext4_mb_regular_allocator
164 ext4_mb_init_cache
156 ext4_mb_new_blocks
152 ext4_mb_release_inode_pa
136 ext4_mb_seq_history_show
124 ext4_mb_release_group_pa
124 ext4_mb_init
...

to:

176 ext4_mb_regular_allocator
164 ext4_mb_init_cache
156 ext4_mb_new_blocks
124 ext4_mb_init
112 ext4_mb_free_blocks
...
44 ext4_mb_release_inode_pa
...
16 ext4_mb_release_group_pa

It's a bit shocking how much this matters to the size of
ext4_mb_release_inode_pa etc; I've not yet found the 
reason why.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>

---

Index: linux-2.6.24-git9/fs/ext4/mballoc.c
===================================================================
--- linux-2.6.24-git9.orig/fs/ext4/mballoc.c
+++ linux-2.6.24-git9/fs/ext4/mballoc.c
@@ -367,10 +367,9 @@
 #endif
 
 /*
- * with EXT4_MB_HISTORY mballoc stores last N allocations in memory
- * and you can monitor it in /proc/fs/ext4/<dev>/mb_history
+ * with CONFIG_EXT4DEV_FS_MBHISTORY mballoc stores last N allocations in
+ * memory and you can monitor it in /proc/fs/ext4/<dev>/mb_history
  */
-#define EXT4_MB_HISTORY
 #define EXT4_MB_HISTORY_ALLOC		1	/* allocation */
 #define EXT4_MB_HISTORY_PREALLOC	2	/* preallocated blocks used */
 #define EXT4_MB_HISTORY_DISCARD		4	/* preallocation discarded */
@@ -562,7 +561,7 @@ struct ext4_buddy {
 #define EXT4_MB_BITMAP(e4b)	((e4b)->bd_bitmap)
 #define EXT4_MB_BUDDY(e4b)	((e4b)->bd_buddy)
 
-#ifndef EXT4_MB_HISTORY
+#ifndef CONFIG_EXT4DEV_FS_MBHISTORY
 static inline void ext4_mb_store_history(struct ext4_allocation_context *ac)
 {
 	return;
@@ -2093,7 +2092,7 @@ out:
 	return err;
 }
 
-#ifdef EXT4_MB_HISTORY
+#ifdef CONFIG_EXT4DEV_FS_MBHISTORY
 struct ext4_mb_proc_session {
 	struct ext4_mb_history *history;
 	struct super_block *sb;
Index: linux-2.6.24-rc6-mm1/fs/Kconfig
===================================================================
--- linux-2.6.24-rc6-mm1.orig/fs/Kconfig
+++ linux-2.6.24-rc6-mm1/fs/Kconfig
@@ -202,6 +202,13 @@ config EXT4DEV_FS_SECURITY
 	  If you are not using a security module that requires using
 	  extended attributes for file security labels, say N.
 
+config EXT4DEV_FS_MBHISTORY
+	bool "Ext4dev mballoc allocator history"
+	help
+	  Enabling this option make it possible to monitor mballoc
+	  allocator history via /proc/fs/ext4/<dev>/mb_history.
+	  Disabling this option will save memory and stack space.
+
 config JBD
 	tristate
 	help

             reply	other threads:[~2008-02-01 20:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01 20:22 Eric Sandeen [this message]
2008-02-01 21:16 ` [PATCH] make mballoc history a config option Eric Sandeen
2008-02-01 21:52   ` Eric Sandeen

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=47A37F85.1050006@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.