Skip to content

Commit

Permalink
mm, hwpoison: remove recalculating hpage
Browse files Browse the repository at this point in the history
hpage is never used after try_to_split_thp_page() in memory_failure(), so
we don't have to update hpage.  So let's not recalculate/use hpage.

Suggested-by: "Aneesh Kumar K.V" <[email protected]>
Signed-off-by: Naoya Horiguchi <[email protected]>
Signed-off-by: Oscar Salvador <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Cc: Aneesh Kumar K.V <[email protected]>
Cc: Aristeu Rozanski <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Dmitry Yakunin <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: Qian Cai <[email protected]>
Cc: Tony Luck <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
nhoriguchi authored and torvalds committed Oct 16, 2020
1 parent 7d9d46a commit 1b473be
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,6 @@ int memory_failure(unsigned long pfn, int flags)
}
unlock_page(p);
VM_BUG_ON_PAGE(!page_count(p), p);
hpage = compound_head(p);
}

/*
Expand Down Expand Up @@ -1413,11 +1412,8 @@ int memory_failure(unsigned long pfn, int flags)
/*
* Now take care of user space mappings.
* Abort on fail: __delete_from_page_cache() assumes unmapped page.
*
* When the raw error page is thp tail page, hpage points to the raw
* page after thp split.
*/
if (!hwpoison_user_mappings(p, pfn, flags, &hpage)) {
if (!hwpoison_user_mappings(p, pfn, flags, &p)) {
action_result(pfn, MF_MSG_UNMAP_FAILED, MF_IGNORED);
res = -EBUSY;
goto out;
Expand Down

0 comments on commit 1b473be

Please sign in to comment.