Re: all mutexes -> read-write locks?



Hello Julian,

* Julian Elischer <julian@xxxxxxxxxxxx> wrote:
it has been mentioned several times that through the evolution of the
locking primitives it has come to be that mutexes and exclusively
acquired reader-writer locks are almost the same in terms of overhead
and that it might be a good move to define all mutexes to be
actually just that.

this would allow people to slowly go through the system, catching low
hanging fruit by converting some of the mutex operations to reader
acquisitions wherever a writer is not required, thus reducing general
system contention.

Is there any thought on this? Last I heard jhb had confirmed that it
was feasible..

If this is going to be done, could we have mtx_* macro's pointing to the
proper read/write ops? I know, it's just names, but I think most novice
FreeBSD kernel hackers will almost instantaneously figure out what 'mtx'
stands for.

Why not make read/write locking a fundamental part of 'mtx' itself, if
it doesn't introduce much overhead?

--
Ed Schouten <ed@xxxxxxxx>
WWW: http://80386.nl/

Attachment: pgp37p1ncnyFE.pgp
Description: PGP signature



Relevant Pages

  • Re: Progress on scaling of FreeBSD on 8 CPU systems
    ... If moving away from sleepable mutexes introduces more ... Why don't the sleepable locking primitives perform better? ... My intention is to both get the sx locks changes into the tree so that sx ... John Baldwin ...
    (freebsd-current)
  • Re: all mutexes -> read-write locks?
    ... locking primitives it has come to be that mutexes and exclusively ... acquired reader-writer locks are almost the same in terms of overhead ... FreeBSD kernel hackers will almost instantaneously figure out what 'mtx' ... I don't think changing all mutex operations to rdlock operations ...
    (freebsd-arch)
  • Re: all mutexes -> read-write locks?
    ... locking primitives it has come to be that mutexes and exclusively ... acquired reader-writer locks are almost the same in terms of overhead ... FreeBSD kernel hackers will almost instantaneously figure out what 'mtx' ... I don't think changing all mutex operations to rdlock operations ...
    (freebsd-arch)
  • Re: all mutexes -> read-write locks?
    ... locking primitives it has come to be that mutexes and exclusively ... acquired reader-writer locks are almost the same in terms of overhead ... I don't think changing all mutex operations to rdlock operations ...
    (freebsd-arch)