From: Bill Kendall <wkendall@sgi.com>
To: xfs@oss.sgi.com
Subject: [PATCH v2 7/8] xfsdump: path lookup cache must be thread specific
Date: Mon, 7 Nov 2011 14:58:30 -0600 [thread overview]
Message-ID: <1320699511-12281-8-git-send-email-wkendall@sgi.com> (raw)
In-Reply-To: <1320699511-12281-1-git-send-email-wkendall@sgi.com>
The xfsrestore path lookup routine (maps an ino + generation number to a
pathname) contains a cache for fast lookups of consecutive files in the
same parent directory. This cache either needs to be protected by a lock
or a cache is needed per thread. I took the latter approach since it
doesn't add lock contention and it increases the cache hit rate (it's
relatively unlikely that each stream is processing files in the same
directory).
Signed-off-by: Bill Kendall <wkendall@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
restore/tree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/restore/tree.c b/restore/tree.c
index 7bddddf..9e4e83c 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -3441,7 +3441,7 @@ Node2path( nh_t nh, char *path, char *errmsg )
static intgen_t
Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
{
- static path_cache_t cache = { NH_NULL, 0, "" };
+ static __thread path_cache_t cache = { NH_NULL, 0, "" };
node_t *np;
nh_t parh;
xfs_ino_t ino;
--
1.7.0.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2011-11-07 20:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-07 20:58 [PATCH v2 0/8] xfsdump: enable support for multiple streams Bill Kendall
2011-11-07 20:58 ` [PATCH v2 1/8] xfsdump: link with libpthread Bill Kendall
2011-11-08 2:02 ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 2/8] xfsdump: remove multi-stream synchronous dir dump Bill Kendall
2011-11-08 2:02 ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 3/8] xfsdump: implement lock abstraction with pthreads Bill Kendall
2011-11-08 2:02 ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 4/8] xfsdump: simplify qlock ordinal bitmap Bill Kendall
2011-11-08 2:02 ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 5/8] xfsdump: convert IRIX sproc threads to pthreads Bill Kendall
2011-11-08 2:02 ` Alex Elder
2011-11-07 20:58 ` [PATCH v2 6/8] xfsdump: process thread exit status Bill Kendall
2011-11-08 2:03 ` Alex Elder
2011-11-07 20:58 ` Bill Kendall [this message]
2011-11-08 2:03 ` [PATCH v2 7/8] xfsdump: path lookup cache must be thread specific Alex Elder
2011-11-07 20:58 ` [PATCH v2 8/8] xfsdump: enable multiple streams Bill Kendall
2011-11-08 2:03 ` Alex Elder
2011-11-10 11:00 ` [PATCH v2 0/8] xfsdump: enable support for " Christoph Hellwig
2011-11-10 16:22 ` Bill Kendall
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=1320699511-12281-8-git-send-email-wkendall@sgi.com \
--to=wkendall@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