From: Naoya Horiguchi Date: Fri, 16 Oct 2020 03:06:42 +0000 (-0700) Subject: mm, hwpoison: remove recalculating hpage X-Git-Tag: v5.10-rc1~106^2~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b473becde09d1aec17334a34af70ccdee9fe680;p=thirdparty%2Fkernel%2Flinux.git mm, hwpoison: remove recalculating hpage 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" Signed-off-by: Naoya Horiguchi Signed-off-by: Oscar Salvador Signed-off-by: Andrew Morton Reviewed-by: Mike Kravetz Cc: Aneesh Kumar K.V Cc: Aristeu Rozanski Cc: Dave Hansen Cc: David Hildenbrand Cc: Dmitry Yakunin Cc: Michal Hocko Cc: Oscar Salvador Cc: Qian Cai Cc: Tony Luck Link: https://lkml.kernel.org/r/20200922135650.1634-3-osalvador@suse.de Signed-off-by: Linus Torvalds --- diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 484f968641d19..6876757f4b856 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -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); } /* @@ -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;