linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* s390's PageSwapCache test
@ 2008-08-02  9:05 Hugh Dickins
  2008-08-02 16:20 ` Martin Schwidefsky
  0 siblings, 1 reply; 3+ messages in thread
From: Hugh Dickins @ 2008-08-02  9:05 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: linux-mm

Hi Martin,

I'm slightly bothered by that PageSwapCache() test you've just added
in page_remove_rmap(), before s390's page_test_dirty():

		if ((!PageAnon(page) || PageSwapCache(page)) &&
		    page_test_dirty(page)) {
			page_clear_dirty(page);
			set_page_dirty(page);
		}

It's not wrong; but if it's necessary, then I need to understand why;
and if it's unnecessary, then we'd do better to remove it (optimizing
your optimization a little).

I believe it's unnecessary: it is possible, yes, to arrive here and
find the anon page dirty with respect to what's on swap disk; but
because anon pages are COWed, never sharing modification with other
users, that will only be so if we're the only user of that page, and
about to free it, in which case no point in doing the set_page_dirty().

For a very similar case, see the PageAnon() test in zap_pte_range(),
where we also skip the set_page_dirty().

Hugh

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-02 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-02  9:05 s390's PageSwapCache test Hugh Dickins
2008-08-02 16:20 ` Martin Schwidefsky
2008-08-02 18:44   ` Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox