Re: [patch] my latest oom stuff

Richard Gooch (rgooch@atnf.csiro.au)
Mon, 26 Oct 1998 13:40:49 +1100


Linus Torvalds writes:
>
>
> On Sun, 25 Oct 1998, Andrea Arcangeli wrote:
> >
> > Hmm, it could be the shrink_mmap() shift factor that it' s too big too.
> > But really, changing tries to tries/2 or decreasing of a *2 the
> > shrink_mmap() path will make no big differences, the only important thing
> > is to stop kswapd when it' s running all the time. As just said we can use
> > a more sofisticate heuristic than mine ;-) to stop kswapd.
>
> Actually, I'd prefer a _stupider_ approach, which would be to get rid of
> "tries" altogether, and instead do:
>
> unsigned long start = jiffies;
>
> do {
> .. swapout ..
> } while (jiffies == start);
>
> which essentially throttles kswapd to run at most one jiffy (and that in
> turn pretty much guarantees that kswapd at MOST can ever run 50% of the
> time, which is pretty close to the kind of guarantee we want).

I don't understand how you get the 50% number. If the above snippet is
in a function, the first time I call the function it runs for one
jiffie. Next time I call it (a fraction of a jiffie later), it runs
for almost one jiffie. Is there some other subtlety I'm missing?

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/