Re: [test program] for OOM situations

Andrea Arcangeli (andrea@suse.de)
Mon, 12 Jul 1999 22:28:45 +0200 (CEST)


On Mon, 12 Jul 1999, Stephen C. Tweedie wrote:

>On Fri, 9 Jul 1999 20:34:23 +0200 (MEST), Bernd Kaindl <bk@suse.de>
>said:
>
>>> - nr_good_pages = swap_header->info.last_page - i;
>>> + nr_good_pages = swap_header->info.last_page -
>>> + swap_header->info.nr_badpages -
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> + 1 /* header page */;
>
>No, this needs to be "... - i - 1", or we'll still overestimate the free
>swap pages if the swap device has any bad pages marked.

IMO, we just don't count the badpages as good pages. Basically `i' is an
alias for `swap_header->info.nr_badpages' but using
`swap_header->info.nr_badpages' is more robust.

Andrea

-
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/