From patchwork Tue Aug 24 02:09:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12453807 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 90777C4338F for ; Tue, 24 Aug 2021 02:09:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1AF9C61361 for ; Tue, 24 Aug 2021 02:09:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1AF9C61361 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AAFD66B0072; Mon, 23 Aug 2021 22:09:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A615F6B0073; Mon, 23 Aug 2021 22:09:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9286A8D0001; Mon, 23 Aug 2021 22:09:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id 79CF76B0072 for ; Mon, 23 Aug 2021 22:09:56 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0A09C1EA10 for ; Tue, 24 Aug 2021 02:09:56 +0000 (UTC) X-FDA: 78508343592.30.9108D21 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf06.hostedemail.com (Postfix) with ESMTP id B9AC2801A89B for ; Tue, 24 Aug 2021 02:09:55 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id m17so4261193plc.6 for ; Mon, 23 Aug 2021 19:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=08aO+jCRMsaJzTjrGQzurk0ey1pwgskCgL+V9erG5PI=; b=HacAj8LOl7rXmKqFsrgFe+j6OYcCwSQZdP2HTYoXSmWLDyG9Aame1o/kUZm1FFOJKC zjn0prjj4mbXFpbVrfgUhbZmo8owsR3RCcCYliysA5DZqi3ShKOsxriOCjCMvmxpw+GU qHSoj3azCT9cmRDoiZclndv7vDxFCTptKkN6oAep3+XvlH8LArGjt3R9bFKzRuGnMMDh O7yiV97xpJlIj88kx/nP10V3LHJxZmgJDfRHdSNReVlUBCLrIRlBMmy2ezz9jdd751vS coM+Ic+EDMjcSnl8QJere9pKGU7Yx4qFKsFLXy0SMd66LuK6Gmpt5xPQg6HAJjC5nEwT Rh/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=08aO+jCRMsaJzTjrGQzurk0ey1pwgskCgL+V9erG5PI=; b=pSe7Ad303RrG30BqoCiXNmket17wLx0o8RrMicUIckTvvaOl+YwO7EacHYido9iMhY x4fDtGgoZ7fyCknF9RuTdZMtTnw3taDdX/wboeMK/cH9NXoyoZvsyH3t6CPniMQzHK6m dBpHg/EfJ/GRHGA9SBOMdij3YqUVrEHYrcxrWRgESkDgs1Pj7ZJ7vlsel8M8QM3d8Nih 25jKd3rVFdrOkek50wkKDN4W++ik+npaIdrQW0aOG5e+buboRzFqqspCost+9JKYz6OL JAleqFp58ky2Ht2ZtfopoKoV1vp9zOTKRf5aP1w3gcdP/VgZ+qrvYuY8HuJRb0tuAkwG PN7g== X-Gm-Message-State: AOAM532bOFLezzrdAua2dKt4pE1joSVFYuZEHaMUdi6uInZvJXe6iCB2 Q0QwKA1SF23209RuvMvbvLE= X-Google-Smtp-Source: ABdhPJyGNV5HuEEKZxUHIsJX1mAeS/d7mg3XfPJq06DFfWLjzyKS6QJXiQyVdDwyEyX7QAHYbiNw7A== X-Received: by 2002:a17:902:9b90:b029:12d:5ce1:4d99 with SMTP id y16-20020a1709029b90b029012d5ce14d99mr30701209plp.37.1629770994784; Mon, 23 Aug 2021 19:09:54 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id h16sm16830958pfn.215.2021.08.23.19.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 19:09:53 -0700 (PDT) From: Yang Shi To: naoya.horiguchi@nec.com, osalvador@suse.de, tdmackey@twitter.com, david@redhat.com, willy@infradead.org, akpm@linux-foundation.org, corbet@lwn.net Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 3/3] mm: hwpoison: dump page for unhandlable page Date: Mon, 23 Aug 2021 19:09:46 -0700 Message-Id: <20210824020946.195257-3-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210824020946.195257-1-shy828301@gmail.com> References: <20210824020946.195257-1-shy828301@gmail.com> MIME-Version: 1.0 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=HacAj8LO; spf=pass (imf06.hostedemail.com: domain of shy828301@gmail.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B9AC2801A89B X-Stat-Signature: qfassj7unota7xqdgaiteupao17ypf8e X-HE-Tag: 1629770995-156160 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Currently just very simple message is shown for unhandlable page, e.g. non-LRU page, like: soft_offline: 0x1469f2: unknown non LRU page type 5ffff0000000000 () It is not very helpful for further debug, calling dump_page() could show more useful information. Calling dump_page() in get_any_page() in order to not duplicate the call in a couple of different places. It may be called with pcp disabled and holding memory hotplug lock, it should be not a big deal since hwpoison handler is not called very often. Suggested-by: Matthew Wilcox Cc: Naoya Horiguchi Cc: Oscar Salvador Signed-off-by: Yang Shi Acked-by: Naoya Horiguchi Reviewed-by: David Hildenbrand --- v3: * Remove redundant pr_info per Noaya Horiguchi mm/memory-failure.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 7cfa134b1370..5f8249e4d7dc 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1228,6 +1228,9 @@ static int get_any_page(struct page *p, unsigned long flags) ret = -EIO; } out: + if (ret == -EIO) + dump_page(p, "hwpoison: unhandlable page"); + return ret; } @@ -2205,9 +2208,6 @@ int soft_offline_page(unsigned long pfn, int flags) try_again = false; goto retry; } - } else if (ret == -EIO) { - pr_info("%s: %#lx: unknown page type: %lx (%pGp)\n", - __func__, pfn, page->flags, &page->flags); } return ret;