Optimizing mutex alignment viz cache line access

Bosko Milekic bmilekic at technokratis.com
Wed Jun 25 08:11:01 PDT 2003


On Tue, Jun 24, 2003 at 08:34:31PM +0100, Bruce M Simpson wrote:
[...]
> Would the workaround, then, not be to modify the mtx_*() set of functions
> to use a zone allocator, whose allocation function could then be tuned to
> allocate the lock structure which is frobbed by the atomic_*() functions
> on separate cache lines?
> 
> BMS

  Not all mutexes are dynamically allocated.

  Also, you have to really be careful here.  There may not be much of a
  point in spending all this time re-aligning the actual lock knob in
  the structure, which is accessed atomically with the bus locked all
  the time.

  There are a lot of structures which could probably be re-organized for
  cache gain purposes but at this point we have so many structures
  changing so quickly that this sort of change becomes difficult to do
  properly.

-- 
Bosko Milekic  *  bmilekic at technokratis.com  *  bmilekic at FreeBSD.org
TECHNOkRATIS Consulting Services  *  http://www.technokratis.com/


More information about the freebsd-hackers mailing list