Re: oddity with page_launder() handling of dirty pages

Linus Torvalds (torvalds@transmeta.com)
Tue, 8 May 2001 14:51:37 -0700 (PDT)


On Tue, 8 May 2001, Marcelo Tosatti wrote:
>
> Linus, since you wrote that part of the code, I ask you: do you have any
> reason to not remove a page being writepage()'d from the
> inactive_dirty_list to avoid this kind of problems ?
>
> (the page must be added back to the inactive_dirty_list again after the
> writeout, yes).

This is the reason. I think it is absolutely _wrong_ to add it back after
the writeout - anything could have happened to the page, including the
page moving to other lists or not being a page cache page AT ALL.

We had tons of bugs in this area when the page lists were introduced.

Leaving it on the list and letting anybody who changed the state of the
page remove it cleanly fixed all the bugs. And I'm not going back to the
old and broken code.

You can move it to the "active_list" if you want to while it is being
written out ("it's busy, so it's active"). As long as you move it _before_
you start the write-out.

Linus

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