From: Lachlan McIlroy <lachlan@sgi.com>
To: xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] Tweak tracing allocation sizes
Date: Tue, 02 Sep 2008 15:48:46 +1000 [thread overview]
Message-ID: <48BCD3BE.5040107@sgi.com> (raw)
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
next reply other threads:[~2008-09-02 5:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-02 5:48 Lachlan McIlroy [this message]
2008-09-02 5:56 ` [PATCH] Tweak tracing allocation sizes 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
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=48BCD3BE.5040107@sgi.com \
--to=lachlan@sgi.com \
--cc=xfs-dev@sgi.com \
--cc=xfs@oss.sgi.com \
/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