site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Derek On Dec 15, 2006, at 12:07 PM, Matt Darland wrote: ---- Thanks, Matt _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/drk%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... Correct, those fields indicate the number of acquisition attempts, acquisition attempt misses, and the number of misses which caused the acquisition attempt to block respectively (essentially, the mutex routines can spin briefly before blocking if the thread holding the mutex is active on another processor). However, these lock contention statistics are gathered only if either the kernel was booted with the "lcks=3" boot-arg (this enables statistics gathering for all lock groups), or if the statistics and debug attributes have been enabled programmatically for a particular lock group (via lck_grp_attr_setstat) and the mutex (via lck_attr_setdebug). Note that this applies to lck_mtx_lock and variants; the deprecated mutex_ style routines don't collect contention statistics. Also, and whilst I've addressed this for Leopard/x86 (along with additional statistics), the asm mutex implementations on the 10.4 series x86 kernels don't gather contention statistics (but the PowerPC implementations do). There is an interface to collect these statistics from user space, and a program to do so (lockstat, which has options such as periodic stats delta display), but I don't think it's been packaged up for external use. If you think you'll find that useful, feel free to contact me off-list and I'll send you a copy. What do the 'util', 'miss', and 'wait' fields indicate in the showallmtx macro of the kgmacros package? Does this give an idea as to the relative level of contention for locks within a lock group? This email sent to drk@apple.com This email sent to site_archiver@lists.apple.com