Source-Changes archive

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

Re: CVS commit: [vmlocking] src/sys/uvm



On Sun, Apr 29, 2007 at 06:20:25PM +0100, David Laight wrote:

> On Sat, Apr 28, 2007 at 08:47:04PM +0000, Andrew Doran wrote:
> > 
> > Module Name:        src
> > Committed By:       ad
> > Date:               Sat Apr 28 20:47:04 UTC 2007
> > 
> > Modified Files:
> >     src/sys/uvm [vmlocking]: uvm.h uvm_init.c uvm_page.c
> > 
> > Log Message:
> > Split uvm_hashlock into an array of 32 locks.
> 
> Is it sensible to put more than one lock in a single cache line?

Not really, but I was worried about overhead.

> (Which is what I suspect this change does.)
> Since that generates many more cache snoops that strictly necessary.

I think a reasonable strategy would be to size the array based on 'ncpu',
allocate it at runtime and pad the locks out. So with one CPU you'd get
one lock, with more you'd get 32. It would require doing a rehash after
autoconfig but most of the code is already there.

Andrew



Home | Main Index | Thread Index | Old Index