Re: Ideas for reducing memory copying and zeroing times

Ingo Molnar (mingo@pc5829.hil.siemens.co.at)
Tue, 16 Apr 1996 15:51:25 +0200 (MET DST)


On Tue, 16 Apr 1996, Jamie Lokier wrote:

> [cool ideas snipped out]

> Zero-mapped pages
> =================
>
> [snip]
>
> low-priority kernel thread) fill out a pool of pre-zeroed pages. When a
> process needs a zero page, if there are any in the pool it can have one
> immediately by remapping a page -- no copy on write required. Of
> course, under constant load the pool would be empty so you still need
> the fast zeroing code. At least at the start of a burst of activity
> there would be a much reduced zeroing time (such as when a program
> starts up and fills its data area). And with SMP even if all but one
> CPU is loaded, there might be a spare one with enough idle time to keep
> the pool going for the others.

currently, apart from a (usually very small) initial time, all buffers
are in use. There is a small amount of free pages reserved for interrupt
handlers and alike, but "pages that could be zeroed out" are not
available.

There are two opposing events:

1) cached data at the end of the LRU list is needed
2) a zeroed out page is needed

if P(1) < P(2), then the whole thing makes sense, and defines an optimal
poolsize for zeroed out pages. And if we miss 1), then we are penaltized
quite badly, an unnecessary IO operation occurs. (so the relation should
be weighed by the cost of misses)

-- mingo