Re: Kernel 2.6.8.1: swap storm of death - nr_requests > 1024 on swap partition

Andrew Morton
2004-08-30T22:37:30Z

Marcelo Tosatti <marcelo.tosatti@cyclades.com> wrote:
>
> static int may_write_to_queue(struct backing_dev_info *bdi)
> {
> + int nr_writeback = read_page_state(nr_writeback);
> +
> + if (nr_writeback > (totalram_pages * 25 / 100)) {
> + blk_congestion_wait(WRITE, HZ/5);
> + return 0;
> + }

That's probably a good way of special-casing this special-place problem.

For a final patch I'd be inclined to take into account /proc/sys/vm/dirty_ratio
and to avoid running the expensive read_page_state() once per writepage.