Subject: Re: duplicated code in machdep.c
To: Paul Kranenburg <pk@cs.few.eur.nl>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-kern
Date: 11/14/1997 18:49:07
On Sat, 15 Nov 1997 01:59:23 +0100 (MET),
  Paul Kranenburg <pk@cs.few.eur.nl> writes:

>I'm not suggesting malloc'ing the entire buffer cache, nor, at this
>moment, using malloc() for the buffers themselves (ie. the
>`struct buffer's).
>
>The other valloc'ed things are relatively small: around 8K for the
>callout queue, and about 30K for the collective SYSV stuff.



Paul,

size is not the only issue. There's still the cost of mapping the darn
things into kernel-virtual address space, and the cost of any
associated page-misses.

On a mips, where TLB misses are handled in software, that's adding a
signficant extra TLB-miss cost to references to the struct bufs.  I'd
guess the first reference to most buffers on any IO and on each
interrupt would miss.

I'm sure that has a measurable impact, and quite possibly a
significant one.  (TLB misses and miss cost is one of _the_ big things
to tune for on a mips.)

I don't know for sure without trying it, though.

For the sysV IPC goop, its still another 38k worth of TLB entries
consumed to map the darn things into kernel address space.  On a mips,
the extra TLB thrashing could have a measurable impact on processes
using the SysV IPC emulation.