Re: [PATCH] swap_state.c thinko

Bulent Abali
2001-04-06T20:20:17Z

>So I don't think it would necessarily be wrong to say
>something like
>
> free -= num_physpages >> 6;
>
>to approximate the notion of "keep 1 percent slop" (remember, the 1% may
>well be on the swap device, not actually kept as free memory).

Hi,

I suggested the same thing to Rik but he rightfully said that it would
not work well for diskless (or swap-less) machines. You may want to
consider the following instead.

free -= (nr_swap_pages)? num_physpages >> 6 : 0;

By the way, disk space is cheap why not give more than 1 percent slop?
This is really accounted in the swap space and not the memory.
It will also help system out of oom_killer's radar.

Bulent Abali (abali@us.ibm.com)