[rfc] migrate lagg to an rmlock

John Baldwin jhb at freebsd.org
Thu Aug 29 14:58:15 UTC 2013


On Saturday, August 24, 2013 10:16:33 am Robert Watson wrote:
> There are a number of other places in the kernel where migration to an rmlock 
> makes sense -- however, some care must be taken for four reasons: (1) while 
> read locks don't experience line contention, write locking becomes observably 
> e.g., rmlocks might not be suitable for tcbinfo; (2) rmlocks, unlike rwlocks, 
> more expensive so is not suitable for all rwlock line contention spots -- 
> implement reader priority propagation, so you must reason about; and (3) 
> historically, rmlocks have not fully implemented WITNESS so you may get less 
> good debugging output.  if_lagg is a nice place to use rmlocks, as 
> reconfigurations are very rare, and it's really all about long-term data 
> stability.

3) should no longer be an issue.  rmlocks now have full WITNESS and assertion
support (including an rm_assert).

However, one thing to consider is that rmlocks pin readers to CPUs while the
read lock is held (which rwlocks do not do).

-- 
John Baldwin


More information about the freebsd-net mailing list