Christoph Lameter <[email protected]> wrote:
> > - rebased on top of David Howells' page_mkwrite() patch.
> I am a bit confused about the need for Davids patch. set_page_dirty() is
> already a notification that a page is to be dirtied. Why do we need it
> twice? set_page_dirty could return an error code and the file system can
> use the set_page_dirty() hook to get its notification. What we would need
> to do is to make sure that set_page_dirty can sleep.
page_mkwrite() is called just before the _PTE_ is dirtied. Take do_wp_page()
for example, set_page_dirty() is called after a lot of stuff, including some
stuff that marks the PTE dirty... by which time it's too late as another
thread sharing the page tables can come along and modify the page before the
first thread calls set_page_dirty().
Furthermore, by that point, it's pointless to have set_page_dirty() return an
error by then. The deed is effectively done: the PTE is marked dirty and
And also as you pointed out, set_page_dirty() needs to be able to sleep.
There are places where it's called still, even with Peter's patch, with the
page table lock held - zap_pte_range() for example. In that particular case,
dropping the lock for each PTE would be bad for performance.
Basically, you can look at it as page_mkwrite() is called upfront, and
set_page_dirty() is called at the end.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Video 4 Linux]
[Linux for the blind]