understand the result of lockstat

Zheng Da zhengda1936 at gmail.com
Thu Oct 6 11:25:47 EDT 2011


Hello,

I try to analyze the lock contention in the linux FS, so I enable
lockstats in the kernel. But I have some troubles to understand the
result in lockstats.
When I read 4GB data randomly from a file on a ramdisk with 8 threads
(I have 8 cores), and it takes 21 seconds.
The most contended lock is
class name    				con-bounces	contentions	waittime-min	waittime-max
	waittime-total	acq-bounces	acquisitions	holdtime-min	holdtime-max	holdtime-total
&(&mapping->tree_lock)->rlock	104380		104615		0			0			61705.23		169228		2862470		0			0			1010557.22
&(&zone->lru_lock)->rlock		1233			1245			0			0			2632.71		21834		255752		0			3.86			402904.1
xtime_lock					722			731			0			0			1916.15		1342			2901			0			0			4812.51
What is unit of the waittime? in nanoseconds? I look into the code of
x86, and it seems the clock time the code reads is nanoseconds. But if
it's in nanoseconds, the wait time of mapping->tree_lock is very
short, only 62us in total?
Also, the result shows that there are 104615 contentions out of
2862470 acquisitions. I guess it's not very highly contended.

Thanks,
Da



More information about the Kernelnewbies mailing list