mm, thp: Do not make page table dirty unconditionally in touch_p[mu]d()
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Mon, 27 Nov 2017 03:21:25 +0000 (06:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Dec 2017 10:26:28 +0000 (11:26 +0100)
commit01ca9727457a167463a47e35b6fe5a5173b4e341
tree165e9a1d594870c6198dd0f3c771c180a3930ee9
parent786b924d39bad16ff99aacdb4076df027cc2f8b8
mm, thp: Do not make page table dirty unconditionally in touch_p[mu]d()

commit a8f97366452ed491d13cf1e44241bc0b5740b1f0 upstream.

Currently, we unconditionally make page table dirty in touch_pmd().
It may result in false-positive can_follow_write_pmd().

We may avoid the situation, if we would only make the page table entry
dirty if caller asks for write access -- FOLL_WRITE.

The patch also changes touch_pud() in the same way.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/huge_memory.c