]> git.baikalelectronics.ru Git - kernel.git/commit
mm, madvise_inject_error: Let memory_failure() optionally take a page reference
authorDan Williams <dan.j.williams@intel.com>
Sat, 14 Jul 2018 04:50:06 +0000 (21:50 -0700)
committerDave Jiang <dave.jiang@intel.com>
Mon, 23 Jul 2018 17:38:05 +0000 (10:38 -0700)
commita686f81b582c8b487aafdd1069be576f73b7da59
tree1858e8c39a96a6d61d76deeab9b32b64b549d041
parent1502eb5feec0c3644a32e3830abc6d000244e394
mm, madvise_inject_error: Let memory_failure() optionally take a page reference

The madvise_inject_error() routine uses get_user_pages() to lookup the
pfn and other information for injected error, but it does not release
that pin. The assumption is that failed pages should be taken out of
circulation.

However, for dax mappings it is not possible to take pages out of
circulation since they are 1:1 physically mapped as filesystem blocks,
or device-dax capacity. They also typically represent persistent memory
which has an error clearing capability.

In preparation for adding a special handler for dax mappings, shift the
responsibility of taking the page reference to memory_failure(). I.e.
drop the page reference and do not specify MF_COUNT_INCREASED to
memory_failure().

Cc: Michal Hocko <mhocko@suse.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
mm/madvise.c