Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 2004 22:55:28 -0400
From:      Yaoping Ruan <yruan@cs.princeton.edu>
To:        hackers@freebsd.org
Subject:   Vnode exclusive locking
Message-ID:  <40AACCA0.757478CF@cs.princeton.edu>

next in thread | raw e-mail | index | archive | help
Hi,

Could someone here give me some optimization advice/reference about
vnode locking? Recently we find that vnode lookup locking has
significant negative impact on I/O latency. We trace down to two
places in the source code which initiated the locking:

1. the vn_lock( ) in lookup( ), kern/vfs_lookup.c, which locks the
current directory vnode. I suppose it is released until the target leaf
vnode is found. Does this lock need to be exclusive?

2. the two vget() calls in kern/vfs_cache.c. After looking at the source

code changing logs, it seems that there's a "LOCKSHARED" option to solve

the problem. But this option is not included until release 5.0 or 5.1.
So my question is why it used EXCLUSIVE lock for lookup (which is a
cache hit path)? And is there any other issues if using SHARED lock?

Any explanation and points to references would be greatly appreciated.

-Yaoping





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40AACCA0.757478CF>