tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fileassoc locking



David Laight <david%l8s.co.uk@localhost> wrote:
> > Rw locks has very bad effect on CPU caches and can slow things
> > down on a bigger SMP systems.
> 
> Actually RW locks are probably only ever worthwhile on big SMP systems!
> RW locks allow additional concurrency! <...>

No, not really.  Of course, RW-lock has its use and can be suitable in
many cases.  However, as already wrote in other email, it causes cache
synchronisation among CPUs, which is relatively expensive on bigger MP
systems (imagine the traffic on a system with 32 CPUs or more!).  Mutual
exclusion at the cache level on reader side can cause relatively strong
effect (quite noticeable on recent multi-core x86 systems).

For very intensive read-mostly locking, there are alternatives, such
as read-optimised locks (with a high cost of write-locking), RCU-like
synchronisation, lockless design or perhaps other tricks.  :)

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index