Re: page_launder() bug

Marcelo Tosatti (marcelo@conectiva.com.br)
Tue, 8 May 2001 18:16:03 -0300 (BRT)


On Mon, 7 May 2001, Linus Torvalds wrote:

>
> On Mon, 7 May 2001, Marcelo Tosatti wrote:
> >
> > So what about moving the check for a dead swap cache page from
> > swap_writepage() to page_launder() (+ PageSwapCache() check) just before
> > the "if (!launder_loop)" ?
> >
> > Yes, its ugly special casing. Any other suggestion ?
>
> My most favourite approach by far is to just remove the magic for
> different writepage's altogether, and just unconditionally do a
> writepage. But passing in enough information so that the writepage can
> come to the right decision.
>
> So take the old code, and remove the code that does
>
> if (!launder_loop) {
> .. move to head ..
> continue;
> }
> writepage(page);
>
> and instead make it do something like
>
> if (writepage(page, launderloop)) {
> .. not able to write, move to head ..
> continue;
> }
>
> where "launderloop" is passed in to the writepage function as a priority.

There are two issues which I missed yesterday: we have to get a reference
on the page, mark it clean, drop the locks and then call writepage(). If
the writepage() fails, we'll have to set_page_dirty(page).

I guess this is too much overhead for the common case, don't you?

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