Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d6f8bb1310d4745ff1d0c74eeacae31e2a3eeff1
Commit:     d6f8bb1310d4745ff1d0c74eeacae31e2a3eeff1
Parent:     30475cc12a50816f290828fb7e3cd7036cd622df
Author:     Hugh Dickins <[EMAIL PROTECTED]>
AuthorDate: Sat Jun 16 10:15:59 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Jun 16 13:16:15 2007 -0700

    i386 mm: use pte_update() in ptep_test_and_clear_dirty()
    
    It is not safe to use pte_update_defer() in ptep_test_and_clear_young():
    its only user, /proc/<pid>/clear_refs, drops pte lock before flushing TLB.
    Use the safe though less efficient pte_update() paravirtop in its place.
    Likewise in ptep_test_and_clear_dirty(), though that has no current use.
    
    These are macros (header file dependency stops them from becoming inline
    functions), so be more liberal with the underscores and parentheses.
    
    Signed-off-by: Hugh Dickins <[EMAIL PROTECTED]>
    Cc: Zachary Amsden <[EMAIL PROTECTED]>
    Cc: David Rientjes <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/asm-i386/pgtable.h |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 2394589..d62bdb0 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -295,22 +295,24 @@ do {                                                      
                \
 
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
 #define ptep_test_and_clear_dirty(vma, addr, ptep) ({                  \
-       int ret = 0;                                                    \
-       if (pte_dirty(*ptep))                                           \
-               ret = test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low); \
-       if (ret)                                                        \
-               pte_update_defer(vma->vm_mm, addr, ptep);               \
-       ret;                                                            \
+       int __ret = 0;                                                  \
+       if (pte_dirty(*(ptep)))                                         \
+               __ret = test_and_clear_bit(_PAGE_BIT_DIRTY,             \
+                                               &(ptep)->pte_low);      \
+       if (__ret)                                                      \
+               pte_update((vma)->vm_mm, addr, ptep);                   \
+       __ret;                                                          \
 })
 
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 #define ptep_test_and_clear_young(vma, addr, ptep) ({                  \
-       int ret = 0;                                                    \
-       if (pte_young(*ptep))                                           \
-               ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); \
-       if (ret)                                                        \
-               pte_update_defer(vma->vm_mm, addr, ptep);               \
-       ret;                                                            \
+       int __ret = 0;                                                  \
+       if (pte_young(*(ptep)))                                         \
+               __ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,          \
+                                               &(ptep)->pte_low);      \
+       if (__ret)                                                      \
+               pte_update((vma)->vm_mm, addr, ptep);                   \
+       __ret;                                                          \
 })
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to