[FOLLOW UP] lockmgr rewriting -- round 2

Attilio Rao attilio at freebsd.org
Sun Apr 6 21:23:46 UTC 2008


As alredy mentioned in earlier e-mail, an optimized version for
lockmgr has been committed less than half an hour ago to CVS stock
kernel.
This has been made necessary because the patch needed a wider coverage
for testing and feedbacks, after a good "troubleshooter" period where
several bugs were fixed.

What does the new patch introduce in the KPI?
Together with a faster implementation, the patch provides the ability
to use a rwlock as interlock, through functions lockmgr_rw() and
lockmgr_args_rw(). This feature (requested by jeff@) has been
implemented through the generic lock layer in a generalized function
(__lockmgr_args(), the real core function for new lockmgr).

What is missing?
Currently, the WITNESS support has been dropped but it is supposed to
be re-added very soon. Other surrounding support (lockmgr stack, ktr
traces, showing vnodes, etc) have been judged enough good to find bugs
so far that WITNESS support can be delayed for the moment.
Also, the draining can be subjected to a race, alredy present in the
old version of lockmgr too. Basically, if a drainer finds a queue of
shared waiters and wake them up and later the first shared owner wakes
up the drainer, the drainer and other shared (eventual) owners will
race fot the lock acquisition.
However LK_DRAIN is not widely used and the current implementation
will have this fixed asap (in the while, this issue is a lot more
mitigated than the old implementation).

Future plans?
In order to get the maximum by the primitive, adaptive spinning
support can be tried. Also other wakeups mechanism can be explored.

Benchmarks?
Kris Kennaway did some rough benchmark alredy with the patch. On some
benchmarks (like mysql in write mode) he experienced a big performance
boost (in order of 200%) while on other a less massive one (myisam
gets improved of a 10%  factor).
We expect, however, that a lot of workload will be improved by this
work so, we wait for you direct experiences on the battle field.

This work has been possible thanks to the generous sponsor of Google
through the Summer of code (2007) program, thanks to the FreeBSD
developers community which picked up this project and in particular
thanks to Jeff Roberson and Kris Kennaway that through revisions and
testing found several bugs.
Peter Holm and Daniel Gerzo, also, tested the patch and confirmed
stability of the work on their particular workloads.

Any further comments and reports will be appreciated by the community.

Thanks,
Attilio


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the freebsd-fs mailing list