]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm, dax: fix livelock, allow dax pmd mappings to become writeable
authorRoss Zwisler <ross.zwisler@linux.intel.com>
Sat, 16 Jan 2016 00:56:02 +0000 (16:56 -0800)
committerDan Duval <dan.duval@oracle.com>
Fri, 9 Dec 2016 18:25:41 +0000 (13:25 -0500)
commitc3c65887ccc866f91e1c7f9278122318b7f07c5d
treefe206442be69cba72b633c17dfb1883771300d97
parente7cc128b81de59fd49a04c1af172a34464f267ef
mm, dax: fix livelock, allow dax pmd mappings to become writeable

Orabug: 22913653

Prior to this change DAX PMD mappings that were made read-only were
never able to be made writable again.  This is because the code in
insert_pfn_pmd() that calls pmd_mkdirty() and pmd_mkwrite() would skip
these calls if the PMD already existed in the page table.

Instead, if we are doing a write always mark the PMD entry as dirty and
writeable.  Without this code we can get into a condition where we mark
the PMD as read-only, and then on a subsequent write fault we get into
an infinite loop of PMD faults where we try unsuccessfully to make the
PMD writeable.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reported-by: Jeff Moyer <jmoyer@redhat.com>
Reported-by: Toshi Kani <toshi.kani@hpe.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 01871e59af5cc1cbf290ad6b4b95cd2f0cec9e8c)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
mm/huge_memory.c