summaryrefslogtreecommitdiffstats
path: root/fs/xfs/support/ktrace.h
diff options
context:
space:
mode:
authorDavid Chinner <dgc@sgi.com>2008-03-06 13:45:43 +1100
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-18 11:40:04 +1000
commitd234154125197053d5215711b5df867979e55ebd (patch)
tree366a6ff91b514a8f9846ac82926e0bbfd0a1fbed /fs/xfs/support/ktrace.h
parent6ee4752ffe782be6e86bea1403a2fe0f682aa71a (diff)
downloadop-kernel-dev-d234154125197053d5215711b5df867979e55ebd.zip
op-kernel-dev-d234154125197053d5215711b5df867979e55ebd.tar.gz
[XFS] Use power-of-2 sized buffers to reduce overhead
Now that the ktrace_enter() code is using atomics, the non-power-of-2 buffer sizes - which require modulus operations to get the index - are showing up as using substantial CPU in the profiles. Force the buffer sizes to be rounded up to the nearest power of two and use masking rather than modulus operations to convert the index counter to the buffer index. This reduces ktrace_enter overhead to 8% of a CPU time, and again almost halves the trace intensive test runtime. SGI-PV: 977546 SGI-Modid: xfs-linux-melb:xfs-kern:30538a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/support/ktrace.h')
-rw-r--r--fs/xfs/support/ktrace.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/support/ktrace.h b/fs/xfs/support/ktrace.h
index 782dbbb..741d694 100644
--- a/fs/xfs/support/ktrace.h
+++ b/fs/xfs/support/ktrace.h
@@ -31,6 +31,7 @@ typedef struct ktrace_entry {
typedef struct ktrace {
int kt_nentries; /* number of entries in trace buf */
atomic_t kt_index; /* current index in entries */
+ unsigned int kt_index_mask;
int kt_rollover;
ktrace_entry_t *kt_entries; /* buffer of entries */
} ktrace_t;
OpenPOWER on IntegriCloud