On Mon, 22 Oct 2007 11:52:33 +0300 Artem Bityutskiy <dedekind@yandex.ru> wrote:
It would be simpler/safer/saner to add a new bitflag to writeback_control
and use that directly. The WB_SYNC_foo flags are a holdover from an
earlier time and really should be made to go away, in favour of directly
setting up an appropriate writeback_control.
Well it might lose its dirty tag, if the thread which has a lock on the
page is about to write it out or truncate it. But that shouldn't concern
you here.
The code you have there looks racy: if someone else locks the page in that
little window after the PageLocked() test we'll still block in lock_page().
That's unlikely to happen in your application (apart from a remaining
ab/ba scenario) but we should make it robust:
if (wbc->skip_locked_pages) {
if (TestSetPageLocked(page))
continue;
} else {
lock_page(page);
}
-