[PATCH] make mballoc history a config option

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

 



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@xxxxxxxxxx>

---

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

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux