LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hugh@veritas.com>, linux-kernel@vger.kernel.org
Subject: [patch -mm 2/2] smaps: use ptep_test_and_clear_young
Date: Sun, 25 Mar 2007 17:35:54 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0703251733080.19025@chino.kir.corp.google.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0703251731040.19025@chino.kir.corp.google.com>

Use arch-specified ptep_test_and_clear_young() to clear the pte accessed
bits for /proc/pid/clear_refs.  This avoids a race condition if a pte is
modified between pte_mkold() and set_pte_at().

Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 fs/proc/task_mmu.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -277,10 +277,7 @@ static void clear_refs_one_pmd(struct vm_area_struct *vma, pmd_t *pmd,
 			continue;
 
 		/* Clear accessed and referenced bits. */
-		if (pte_young(ptent)) {
-			ptent = pte_mkold(ptent);
-			set_pte_at(vma->vm_mm, addr, pte, ptent);
-		}
+		ptep_test_and_clear_young(vma, addr, pte);
 		ClearPageReferenced(page);
 	}
 	pte_unmap_unlock(pte - 1, ptl);

  reply	other threads:[~2007-03-26  0:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26  0:35 [patch -mm 1/2] i386: add ptep_test_and_clear_{dirty,young} David Rientjes
2007-03-26  0:35 ` David Rientjes [this message]
2007-03-26  5:53 ` Hugh Dickins
2007-03-26  7:07   ` Zachary Amsden
2007-03-26  6:27     ` Hugh Dickins
2007-03-26 20:20       ` Zachary Amsden
2007-03-26  6:35     ` David Rientjes
2007-03-26 20:22       ` Zachary Amsden

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0703251733080.19025@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).