All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfs: Fix RCU path walk failiures due to uninitialized nameidata seq number for root directory
@ 2011-04-15 18:39 Tim Chen
  2011-04-15 21:09 ` Andi Kleen
  2011-04-16 10:27 ` Shi, Alex
  0 siblings, 2 replies; 7+ messages in thread
From: Tim Chen @ 2011-04-15 18:39 UTC (permalink / raw
  To: Alexander Viro, Nick Piggin
  Cc: Andi Kleen, linux-fsdevel, linux-kernel, shaohua.li, alex.shi

During RCU walk in path_lookupat and path_openat, the rcu lookup
frequently failed because when root directory was looked up, seq number
was not properly set in nameidata.  We dropped out of RCU walk in
nameidata_drop_rcu due to mismatch in directory entry's seq number.  We
reverted to slow path walk that need to take references.

With the following patch, I saw a 50% increase in an exim mail server
benchmark throughput on a 4-socket Nehalem-EX system.

Thanks.

Tim

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
diff --git a/fs/namei.c b/fs/namei.c
index 3cb616d..e4b27a6 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -697,6 +697,7 @@ static __always_inline void set_root_rcu(struct nameidata *nd)
 		do {
 			seq = read_seqcount_begin(&fs->seq);
 			nd->root = fs->root;
+			nd->seq = __read_seqcount_begin(&nd->root.dentry->d_seq);
 		} while (read_seqcount_retry(&fs->seq, seq));
 	}
 }



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

end of thread, other threads:[~2011-04-16 10:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-15 18:39 [PATCH] vfs: Fix RCU path walk failiures due to uninitialized nameidata seq number for root directory Tim Chen
2011-04-15 21:09 ` Andi Kleen
2011-04-15 21:54   ` Linus Torvalds
2011-04-15 21:54     ` Linus Torvalds
2011-04-16  5:43     ` Sedat Dilek
2011-04-16  5:43       ` Sedat Dilek
2011-04-16 10:27 ` Shi, Alex

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.