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=-8.2 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_BLOCKED autolearn=ham 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 C40C6C4727D for ; Tue, 22 Sep 2020 17:00:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C87F2399A for ; Tue, 22 Sep 2020 17:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600794019; bh=xxDRDlgi8CbDWiooIv9s69nNYPU5yZlL+d+n4yjdwhE=; h=Date:From:To:Subject:Reply-To:List-ID:From; b=2HMdU4Zw6/61S7OwK8sYHP9Ezw0xXc89mVKfW0NDbHL8lMMZ925eti0u5kfc6eG/g ptL8DMPvsaPEJWOD0LRi6iblJrAXJtFICzebKofsn6sc0mJaayNeSEErKhZP8y24Qx VmAFxEMxWzfas+PV6jttgOqrRyI/t8WKSjSjiJQM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726583AbgIVRAT (ORCPT ); Tue, 22 Sep 2020 13:00:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:44448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbgIVRAS (ORCPT ); Tue, 22 Sep 2020 13:00:18 -0400 Received: from X1 (unknown [216.241.194.61]) (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 F357623600; Tue, 22 Sep 2020 17:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600794018; bh=xxDRDlgi8CbDWiooIv9s69nNYPU5yZlL+d+n4yjdwhE=; h=Date:From:To:Subject:From; b=EVrv7kjEUPagsvrdZ8bl3MM+mnmHgNk25khOaF1j2hXziG+j63/709kOdMj4g3F7g 6H2vgE12WtUEF8gEmRudJaPTxSYrC8fbojmev/83cAt6CfZXkkpZBEjHChlMSEmhBs SPHS0JIC+8rmLiQVixsITQ+b3J7dsGQeieuZb2Co= Date: Tue, 22 Sep 2020 10:00:17 -0700 From: akpm@linux-foundation.org To: mm-commits@vger.kernel.org, zeil@yandex-team.ru, tony.luck@intel.com, osalvador@suse.de, osalvador@suse.com, mike.kravetz@oracle.com, mhocko@kernel.org, david@redhat.com, dave.hansen@intel.com, cai@lca.pw, aris@ruivo.org, aneesh.kumar@linux.vnet.ibm.com, aneesh.kumar@linux.ibm.com, naoya.horiguchi@nec.com Subject: + mmhwpoison-inject-dont-pin-for-hwpoison_filter.patch added to -mm tree Message-ID: <20200922170017.DGu4D%akpm@linux-foundation.org> User-Agent: s-nail v14.9.10 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-inject: don't pin for hwpoison_filter has been added to the -mm tree. Its filename is mmhwpoison-inject-dont-pin-for-hwpoison_filter.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mmhwpoison-inject-dont-pin-for-hwpoison_filter.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mmhwpoison-inject-dont-pin-for-hwpoison_filter.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-inject: don't pin for hwpoison_filter Another memory error injection interface debugfs:hwpoison/corrupt-pfn also takes bogus refcount for hwpoison_filter(). It's justified because this does a coarse filter, expecting that memory_failure() redoes the check for sure. Link: https://lkml.kernel.org/r/20200922135650.1634-4-osalvador@suse.de Signed-off-by: Naoya Horiguchi Signed-off-by: Oscar Salvador Cc: "Aneesh Kumar K.V" Cc: Aneesh Kumar K.V Cc: Aristeu Rozanski Cc: Dave Hansen Cc: David Hildenbrand Cc: Dmitry Yakunin Cc: Michal Hocko Cc: Mike Kravetz Cc: Oscar Salvador Cc: Qian Cai Cc: Tony Luck Signed-off-by: Andrew Morton --- mm/hwpoison-inject.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) --- a/mm/hwpoison-inject.c~mmhwpoison-inject-dont-pin-for-hwpoison_filter +++ a/mm/hwpoison-inject.c @@ -26,11 +26,6 @@ static int hwpoison_inject(void *data, u p = pfn_to_page(pfn); hpage = compound_head(p); - /* - * This implies unable to support free buddy pages. - */ - if (!get_hwpoison_page(p)) - return 0; if (!hwpoison_filter_enable) goto inject; @@ -40,23 +35,20 @@ static int hwpoison_inject(void *data, u * This implies unable to support non-LRU pages. */ if (!PageLRU(hpage) && !PageHuge(p)) - goto put_out; + return 0; /* - * do a racy check with elevated page count, to make sure PG_hwpoison - * will only be set for the targeted owner (or on a free page). + * do a racy check to make sure PG_hwpoison will only be set for + * the targeted owner (or on a free page). * memory_failure() will redo the check reliably inside page lock. */ err = hwpoison_filter(hpage); if (err) - goto put_out; + return 0; inject: pr_info("Injecting memory failure at pfn %#lx\n", pfn); - return memory_failure(pfn, MF_COUNT_INCREASED); -put_out: - put_hwpoison_page(p); - return 0; + return memory_failure(pfn, 0); } static int hwpoison_unpoison(void *data, u64 val) _ 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 mmhwpoison-inject-dont-pin-for-hwpoison_filter.patch mmhwpoison-introduce-mf_msg_unsplit_thp.patch mmhwpoison-double-check-page-count-in-__get_any_page.patch