commit | d52605d7cb306aaf86d0e6dede275dbf8a020072 | [log] [tgz] |
---|---|---|
author | Kirill A. Shutemov <[email protected]> | Wed Jan 31 16:18:16 2018 -0800 |
committer | Linus Torvalds <[email protected]> | Wed Jan 31 17:18:38 2018 -0800 |
tree | 2763bc71c0ebeb57c4ea93d95c030623ceb62060 | |
parent | 86fa949b050184ffc53688516a6a83ae5f98d08a [diff] |
mm: do not lose dirty and accessed bits in pmdp_invalidate() Vlastimil noted that pmdp_invalidate() is not atomic and we can lose dirty and access bits if CPU sets them after pmdp dereference, but before set_pmd_at(). The patch change pmdp_invalidate() to make the entry non-present atomically and return previous value of the entry. This value can be used to check if CPU set dirty/accessed bits under us. The race window is very small and I haven't seen any reports that can be attributed to the bug. For this reason, I don't think backporting to stable trees needed. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Kirill A. Shutemov <[email protected]> Reported-by: Vlastimil Babka <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: David Daney <[email protected]> Cc: David Miller <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Nitin Gupta <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vineet Gupta <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>