OK, thanks.
mapping->private_lock is taken there to pin page->buffers()
(Can't lock the page because set_page_dirty is called under
page_table_lock, and other locks).
I'm sure we can just move the spin_unlock up to above the
TestSetPageDirty(), but I need to zenuflect for a while over
why I did it that way.
It's necessary to expose buffer-dirtiness and page-dirtiness
to the rest of the world in the correct order. If we set the
page dirty and then the buffers, there is a window in which writeback
could find the dirty page, try to write it, discover clean buffers
and mark the page clean. We would end up with a !PageDirty page,
on mapping->clean_pages, with dirty buffers. It would never be
written.
Yup. We can move that spin_unlock up ten lines.
-
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/