public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Tweak tracing allocation sizes
@ 2008-09-02  5:48 Lachlan McIlroy
  2008-09-02  5:56 ` Dave Chinner
  0 siblings, 1 reply; 9+ messages in thread
From: Lachlan McIlroy @ 2008-09-02  5:48 UTC (permalink / raw)
  To: xfs-dev, xfs-oss

The size of a single ktrace entry is 16 pointers so 128 bytes.  For the case
of XFS_RW_KTRACE_SIZE which is 128 entries this equates to 16KB and on a system
with 4KB pages that is under memory pressure this can stall that process for a
significant time while it hunts for 4 free pages.  Cutting this value back to
32 means it will only need one page.

Initialize the ktrace system with a zone size of 32 so calls to ktrace_alloc()
that want 32 trace entries (ie 1 page) will go through the ktrace entry zone.
Bump INODE_TRACE_SIZE from 16 to 32 since if we are going to allocate half a
page we might as well give it a full page and have it allocate from the zone
too.

More can be done here but these changes reduce the liklihood of hitting
deadlocks due to memory pressure.

--- a/fs/xfs/linux-2.6/xfs_lrw.h	2008-09-02 15:28:27.000000000 +1000
+++ b/fs/xfs/linux-2.6/xfs_lrw.h	2008-08-22 14:50:55.000000000 +1000
@@ -28,7 +28,7 @@ struct xfs_iomap;
 /*
  * Defines for the trace mechanisms in xfs_lrw.c.
  */
-#define	XFS_RW_KTRACE_SIZE	128
+#define	XFS_RW_KTRACE_SIZE	32
 
 #define	XFS_READ_ENTER		1
 #define	XFS_WRITE_ENTER		2

--- a/fs/xfs/linux-2.6/xfs_super.c	2008-09-02 15:28:27.000000000 +1000
+++ b/fs/xfs/linux-2.6/xfs_super.c	2008-08-22 14:52:58.000000000 +1000
@@ -2151,7 +2151,7 @@ init_xfs_fs(void)
 
 	printk(message);
 
-	ktrace_init(64);
+	ktrace_init(32);
 	vn_init();
 	xfs_dir_startup();
 
--- a/fs/xfs/linux-2.6/xfs_vnode.h	2008-09-02 15:28:27.000000000 +1000
+++ b/fs/xfs/linux-2.6/xfs_vnode.h	2008-08-22 14:52:14.000000000 +1000
@@ -126,7 +126,7 @@ static inline void vn_atime_to_time_t(st
  */
 #if defined(XFS_INODE_TRACE)
 
-#define	INODE_TRACE_SIZE	16		/* number of trace entries */
+#define	INODE_TRACE_SIZE	32		/* number of trace entries */
 #define	INODE_KTRACE_ENTRY	1
 #define	INODE_KTRACE_EXIT	2
 #define	INODE_KTRACE_HOLD	3

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-09-03 12:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-02  5:48 [PATCH] Tweak tracing allocation sizes Lachlan McIlroy
2008-09-02  5:56 ` Dave Chinner
2008-09-02  6:12   ` Lachlan McIlroy
2008-09-02  6:27     ` Dave Chinner
2008-09-02 21:54       ` Christoph Hellwig
2008-09-02  6:50     ` Andi Kleen
2008-09-02 21:55       ` Christoph Hellwig
2008-09-03  7:06         ` Andi Kleen
2008-09-03 12:06           ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox