Why S390 SetPageUptodate() unconditionally clears page dirty state?
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · On Monday 13 September 2010 13:08:17 Martin Schwidefsky wrote:
On Mon, 13 Sep 2010 12:13:47 +0530
Quoted 4 lines · Nikanth Karthikesan
On S390, the
SetPageUptodate()clears the page dirty state, if page was notPG_uptodatebefore. This seems to mark dirty pages read back from swap to be marked as clean. Shouldn'tpage_clear_dirty()be called, only if page is not flagged as dirty?
Quoted 11 lines
To call
page_clear_dirty()only if the page is not dirty would be wrong. s390 keeps the dirty bit in the per-page storage key. The I/O to read a
page will set the per-page dirty bit. ThePG_dirtybit of a page may or may not be set when SetPageUptodate is called. To clear the hardware dirty bit only if the softwarePG_dirtybit is set would result in lots of pages that still have the hardware dirty bit set. Please not that on x86 the dirty-bit is kept in the pte. Since a not up-to-date page can not have any mapper this means that the page won't have any hardware dirty-bits set (that says nothing about the software dirty bitPG_dirty). To create the same state for s390 we clear the storage key unconditionally.
Got it. Thanks for the explanation.
Thanks
Nikanth