From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLACK,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80425C433DF for ; Fri, 31 Jul 2020 20:05:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6128022B43 for ; Fri, 31 Jul 2020 20:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596225941; bh=2sAOeL4j1gHMNn5Bu3rkSSWaesdLAJILYn7cfNLu6bo=; h=Date:From:To:Subject:In-Reply-To:Reply-To:List-ID:From; b=guUOVmx1kB3xtZ2fPCpfPzcNHr/j65s6ulF+tWXf5hSK3AeniubTGLoHS/YqXwF3R g04g9t7PEKLnRdPHkQFRjDbhMvlvn2aftSYTsYyEjuTjGDh8WFIeIviAGY9aXAXN5+ W5atVZd0X+zlaEe+q27qfzVmM01n7mORm7SPqUl0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725938AbgGaUFl (ORCPT ); Fri, 31 Jul 2020 16:05:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:46780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbgGaUFk (ORCPT ); Fri, 31 Jul 2020 16:05:40 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 392BD208E4; Fri, 31 Jul 2020 20:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596225939; bh=2sAOeL4j1gHMNn5Bu3rkSSWaesdLAJILYn7cfNLu6bo=; h=Date:From:To:Subject:In-Reply-To:From; b=hJRNEEcrsJZdUMgTf9MP02hLEZQBnC8mbOmSgAjAHYY1kYeeYJJ+mfZVjZI7iFIyy YUY7E4YhQx6U9a49UN3NeiH2kCLRrNGXbsRWIGKyE6kffcWwvtmzU8R+MCaQkFUA8L N7CpWlxTiYuPt+XkxGJjBT2jUHGgpSgQbwM/gWXw= Date: Fri, 31 Jul 2020 13:05:38 -0700 From: Andrew Morton To: aneesh.kumar@linux.ibm.com, aneesh.kumar@linux.vnet.ibm.com, cai@lca.pw, dave.hansen@intel.com, david@redhat.com, mhocko@suse.com, mike.kravetz@oracle.com, mm-commits@vger.kernel.org, n-horiguchi@ah.jp.nec.com, naoya.horiguchi@nec.com, osalvador@suse.com, osalvador@suse.de, tony.luck@intel.com, zeil@yandex-team.ru Subject: + mmhwpoison-cleanup-unused-pagehuge-check.patch added to -mm tree Message-ID: <20200731200538.th6NlaAXe%akpm@linux-foundation.org> In-Reply-To: <20200723211432.b31831a0df3bc2cbdae31b40@linux-foundation.org> User-Agent: s-nail v14.8.16 Sender: mm-commits-owner@vger.kernel.org Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: mm,hwpoison: cleanup unused PageHuge() check has been added to the -mm tree. Its filename is mmhwpoison-cleanup-unused-pagehuge-check.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-cleanup-unused-pagehuge-check.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-cleanup-unused-pagehuge-check.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Naoya Horiguchi Subject: mm,hwpoison: cleanup unused PageHuge() check Patch series "HWPOISON: soft offline rework", v5. Main focus of this series is to stabilize soft offline. Historically soft offlined pages have suffered from racy conditions because PageHWPoison is used to a little too aggressively, which (directly or indirectly) invades other mm code which cares little about hwpoison. This results in unexpected behavior or kernel panic, which is very far from soft offline's "do not disturb userspace or other kernel component" policy. Main point of this change set is to contain target page "via buddy allocator", where we first free the target page as we do for normal pages, and remove from buddy only when we confirm that it reaches free list. There is surely race window of page allocation, but that's fine because someone really want that page and the page is still working, so soft offline can happily give up. This patch (of 16): Drop the PageHuge check, which is dead code since memory_failure() forks into memory_failure_hugetlb() for hugetlb pages. memory_failure() and memory_failure_hugetlb() shares some functions like hwpoison_user_mappings() and identify_page_state(), so they should properly handle 4kB page, thp, and hugetlb. Link: http://lkml.kernel.org/r/20200731122112.11263-1-nao.horiguchi@gmail.com Link: http://lkml.kernel.org/r/20200731122112.11263-2-nao.horiguchi@gmail.com Signed-off-by: Naoya Horiguchi Signed-off-by: Oscar Salvador Reviewed-by: Mike Kravetz Cc: Aneesh Kumar K.V Cc: Dave Hansen Cc: David Hildenbrand Cc: Dmitry Yakunin Cc: Michal Hocko Cc: Mike Kravetz Cc: Naoya Horiguchi Cc: Tony Luck Cc: Qian Cai Cc: "Aneesh Kumar K.V" Cc: Oscar Salvador Signed-off-by: Andrew Morton --- mm/memory-failure.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/mm/memory-failure.c~mmhwpoison-cleanup-unused-pagehuge-check +++ a/mm/memory-failure.c @@ -1382,10 +1382,7 @@ int memory_failure(unsigned long pfn, in * page_remove_rmap() in try_to_unmap_one(). So to determine page status * correctly, we save a copy of the page flags at this time. */ - if (PageHuge(p)) - page_flags = hpage->flags; - else - page_flags = p->flags; + page_flags = p->flags; /* * unpoison always clear PG_hwpoison inside page lock _ Patches currently in -mm which might be from naoya.horiguchi@nec.com are mmhwpoison-cleanup-unused-pagehuge-check.patch mm-hwpoison-remove-recalculating-hpage.patch mmmadvise-call-soft_offline_page-without-mf_count_increased.patch mmhwpoison-inject-dont-pin-for-hwpoison_filter.patch mmhwpoison-remove-mf_count_increased.patch mmhwpoison-remove-flag-argument-from-soft-offline-functions.patch mmhwpoison-introduce-mf_msg_unsplit_thp.patch mmhwpoison-double-check-page-count-in-__get_any_page.patch