forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm/memory-failure: introduce get_hwpoison_page() for consistent refco…
…unt handling memory_failrue() can run in 2 different mode (specified by MF_COUNT_INCREASED) in page refcount perspective. If MF_COUNT_INCREASED is set, memory_failrue() assumes that the caller takes a refcount of the target page. And if cleared, memory_failure() takes it in it's own. In current code, however, refcounting is done differently in each caller. For example, madvise_hwpoison() uses get_user_pages_fast() and hwpoison_inject() uses get_page_unless_zero(). Calling get_page_unless_zero() on thp tail pages is unexpected and lead to unexpected behavior. n't work for thp tail pages. As a result, memory_failure() can't handle properly refcounting. So this patch introduces get_hwpoison_page() to handle thp tail pages. There's non-trivial change in unpoison_memory(), which returns on thp with "MCE: Memory failure is now running on %#lx\n" message. This is not right when split_huge_page() fails. So this patch also allows unpoison_memory() to run on thp. Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
- Loading branch information
Naoya Horiguchi
committed
May 11, 2015
1 parent
c9de09f
commit 82360a3
Showing
3 changed files
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters