LKML Archive on
help / color / mirror / Atom feed
From: Miklos Szeredi <>
Subject: Re: [patch 5/5] Optimize page_mkclean_one
Date: Sun, 01 Jul 2007 12:29:19 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <> (message from Martin Schwidefsky on Fri, 29 Jun 2007 15:55:35 +0200)

> page_mkclean_one is used to clear the dirty bit and to set the write
> protect bit of a pte. In additions it returns true if the pte either
> has been dirty or if it has been writable. As far as I can see the
> function should return true only if the pte has been dirty, or page
> writeback will needlessly write a clean page.

There are some weird cases, like for example get_user_pages(), when
the pte takes a write fault and the page is modified, but the pte
doesn't become dirty, because the page is written through the kernel

In the get_user_pages() case the page itself is dirtied, so your patch
probably doesn't break that.  But I'm not sure if there aren't similar
cases like that that the pte_write() check is taking care of.

And anyway if the dirty page tracking works correctly, your patch
won't optimize anything, since the pte will _only_ become writable if
the page was dirtied.

So in fact normally pte_dirty() and pte_write() should be equivalent,
except for some weird cases.


      parent reply	other threads:[~2007-07-01 10:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 13:55 [patch 0/5] Various mm improvements Martin Schwidefsky
2007-06-29 13:55 ` [patch 1/5] avoid tlb gather restarts Martin Schwidefsky
2007-06-29 18:56   ` Hugh Dickins
2007-06-29 21:19     ` Martin Schwidefsky
2007-06-30 13:16       ` Hugh Dickins
2007-06-29 13:55 ` [patch 2/5] remove ptep_establish Martin Schwidefsky
2007-06-29 13:55 ` [patch 3/5] remove ptep_test_and_clear_dirty and ptep_clear_flush_dirty Martin Schwidefsky
2007-07-03  1:29   ` Zachary Amsden
2007-07-03  7:26     ` Martin Schwidefsky
2007-06-29 13:55 ` [patch 4/5] move mm_struct and vm_area_struct Martin Schwidefsky
2007-06-29 13:55 ` [patch 5/5] Optimize page_mkclean_one Martin Schwidefsky
2007-06-30 14:04   ` Hugh Dickins
2007-07-01  7:15     ` Martin Schwidefsky
2007-07-01  8:54       ` Hugh Dickins
2007-07-01 13:27         ` Peter Zijlstra
2007-07-02  7:07           ` Martin Schwidefsky
2007-07-01 19:50         ` Martin Schwidefsky
2007-07-01 10:29   ` Miklos Szeredi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [patch 5/5] Optimize page_mkclean_one' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).