Re: Swapped out truly zero pages & big scientific calculations

William Burrow (aa126@fan.nb.ca)
Fri, 17 Jan 1997 13:36:03 -0400 (AST)


On Thu, 16 Jan 1997, Mark Hemment wrote:

>
> mingo wrote:
> > This minipatch is for making statistics about how many truly zero
> > content (but otherwise totally private mapped) pages are swapped
> > out in the system. As it has to check for every page swapped out
> > wether it's zero or not, it slows down swapping ... it's really
> > just for making statistics.
>
> I like this, I'll try and get some stats on my box.
> I believe it's not going to slow down paging out to swap by a
> noticable amount, and if a zero page is found it can be added to the
> pool of zero pages...

To find out what impact the check might have on swapping non-zero pages,
you might keep track of when a non-zero page is detected. I believe that
most non-zero pages have non-zero data at the beginning. To test this
hypothesis, just a another counter to the stats whenever the value of i in
mingo's patch is below a certain value (8 test loops would suit my guess).
The code would look something like:

if (!i)
kstat.zero++
elif (i > (PAGE_SIZE/sizeof(unsigned long int))
kstat.nonzero++

or what have you.

--
William Burrow  --  Fredericton Area Network, New Brunswick, Canada
Copyright 1997 William Burrow  
This line left intentionally blank.
And the one below it.