Namecache lock contention?
Ivan Voras
ivoras at freebsd.org
Fri Jan 28 17:20:58 UTC 2011
On 28 January 2011 16:25, Dan Nelson <dnelson at allantgroup.com> wrote:
> My guess would be:
>
> kern/vfs_cache.c:151 static struct rwlock cache_lock;
> kern/vfs_cache.c:152 RW_SYSINIT(vfscache, &cache_lock, "Name Cache");
>
> The CACHE_*LOCK() macros.c in vfs_cache use cache_lock, so you've got lots
> of possible contention points. procstat -ka and/or dtrace might help you
> determine exactly where.
I'm new with dtrace so I tried this:
lockstat:::rw-block
{
@traces[stack()] = count();
}
with these results:
http://ivoras.net/stuff/rw-block.txt
It's informative because most of the traces are namecache-related. As
suspected, the most blocking occurs in stat().
As this is a rwlock I'd interpret it as waiting for a write lock to be
lifted so the readers can acquire it, but I need to confirm this as
there's a lot of things that can in theory be stat()ed here.
I'm going to continue investigating with dtrace but I'd appreciate
pointers on how to make the output more useful (like including
filenames from stat()).
More information about the freebsd-hackers
mailing list