[lkml]   [1999]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: andrea buffer code (2.2.9-C.gz)

On Wed, 19 May 1999, Andrea Arcangeli wrote:

> The point is that there we don't need a global spinlock but there we can
> scale far more finegriend on per-page basis. If our approch is to scale
> well as possible in SMP without bother to waste some more kbyte of memory
> the spinlock it's required. [...]

this is a mistake some other OSs did in the early SMP stage, _too_
finegrained locking increases the size of kernel objects, increases cache
footprint, sometimes increases the number of lock operations and thus
slows things down.

> [...] You know: to scale better you need to waste
> more memory :-).

Not necesserily, sometimes we need more locks, sometimes we need less. The
point is to have Linux perform better. Putting a spinlock into every
'struct page' wastes some memory (128k RAM on a 128M box, not much, but
not small either), so this issue is not as easy to judge as you appear to
think. Eg. i have threaded the SysV IPC code recently, and actually ended
up _removing_ one particular type of spinlock because it only decreased
measured performance.

> >The spinlock is only acquired for a few lines,
> >perhaps one global spinlock would save memory.
> Yes but I am not worried, and being more finegrined in SMP is more fun :-).

you might not be worried but others are ... Manfred has asked good
questions: is the particular lock you have 'expanded' into per-object
locks contended in tests, have you measured things. OS development is
never 'mathematically clean'.

-- mingo

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:51    [W:0.072 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site