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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 E14E4C4338F for ; Mon, 23 Aug 2021 17:47:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75EE36126A for ; Mon, 23 Aug 2021 17:47:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 75EE36126A 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 1EA6D6B0072; Mon, 23 Aug 2021 13:47:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 19AA26B0073; Mon, 23 Aug 2021 13:47:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B0636B0074; Mon, 23 Aug 2021 13:47:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id E56756B0072 for ; Mon, 23 Aug 2021 13:47:16 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 911AE180257F3 for ; Mon, 23 Aug 2021 17:47:16 +0000 (UTC) X-FDA: 78507076872.15.9B9D5AE Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by imf29.hostedemail.com (Postfix) with ESMTP id 4FCD89000163 for ; Mon, 23 Aug 2021 17:47:16 +0000 (UTC) Received: by mail-ej1-f43.google.com with SMTP id w5so38689491ejq.2 for ; Mon, 23 Aug 2021 10:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1XjqUyJNMd2ZLbkK/sFsLTUvba6HdD4u6vq+rnRJ9HM=; b=cuBLsnPOnipeZtybbChKkUxipN5F5gVvQTKjFPxTRITk42+HTedxhtUBpKefoD/0NN M7UKhN2UEEHrzj+/lAWTrBiMOFBYA+FcZW+S4vilsn6507Ah57B6k0PLbKkLpgQ/OPn/ pp0LTC7mTU55MvAU1msQhSHyj4zRBrQALAsDrSJcCc4v7nTSq7VqZTqnByI9VzfZBsAC g9To5tNK9IQA21FRlcG6iil2XIoiIuBoH99iZPiTAg/3/oLt7cEP1amZw+F6moh2SbhR l3blaxyv3cbtgpiGpG9hbTVsFyvT9omkJrlKZ8IVYEMWUb49AkEsw2vCDJK70DYKIeX5 R6kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1XjqUyJNMd2ZLbkK/sFsLTUvba6HdD4u6vq+rnRJ9HM=; b=fpvv0K2/cFoGzJHVny7sD6rfvhKm0vyPn3rUXV+mafKUr1NV2RZlc7Mic73BaKu62I fKGQA+uNaKMAsC5AONi788deiqfMK7h6h4iAYIb61EaBTr9zi1WwU/CQzsxHxVUxHRrV mfrYuExLkzeD5sHj1M5lBCIUy1XX2KeFragw7wUU77Eb2KtMm8h01tkwFsCbvVYyv6Zi rFss5OVAxSeUMkeo7oJypeirDGhwrHQvVfIRKlgQi1TRNys01FpY2gtFErZYjeY0dhNT YNzodRaCck41pHc5Dn09kJGrIxNeRgGzqMkIJl4aS1GgiKd73rP5kyssO/NyS/m94x5x JM3w== X-Gm-Message-State: AOAM530fkpnnuGo06exWQkMlBWT6+e/fkJ1CQ5OA4ldaG6OWe7I23lMf RnNqOhboZmrSOOUOgMFa5p4Szqe5nfg8z43O8OU= X-Google-Smtp-Source: ABdhPJx75A+zyMRs9Sa6sfWQuacNo49iPMrd71DX2INrL0DQxC7MhflC2jE+NIfPnezwZlFUBjPjXjQ9Uughu9j2UNI= X-Received: by 2002:a17:906:374e:: with SMTP id e14mr15510393ejc.161.1629740834945; Mon, 23 Aug 2021 10:47:14 -0700 (PDT) MIME-Version: 1.0 References: <20210819054116.266126-1-shy828301@gmail.com> <20210819054116.266126-3-shy828301@gmail.com> <20210820064832.GA63355@hori.linux.bs1.fc.nec.co.jp> <20210823050526.GA1452382@hori.linux.bs1.fc.nec.co.jp> In-Reply-To: <20210823050526.GA1452382@hori.linux.bs1.fc.nec.co.jp> From: Yang Shi Date: Mon, 23 Aug 2021 10:47:03 -0700 Message-ID: Subject: Re: [v2 PATCH 3/3] mm: hwpoison: dump page for unhandlable page To: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= Cc: "osalvador@suse.de" , "tdmackey@twitter.com" , "david@redhat.com" , "willy@infradead.org" , "akpm@linux-foundation.org" , "corbet@lwn.net" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=cuBLsnPO; spf=pass (imf29.hostedemail.com: domain of shy828301@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4FCD89000163 X-Stat-Signature: 3uhg9tdh9p6bn3sampgdc81uwmxtbw11 X-HE-Tag: 1629740836-45347 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: On Sun, Aug 22, 2021 at 10:05 PM HORIGUCHI NAOYA(=E5=A0=80=E5=8F=A3=E3=80= =80=E7=9B=B4=E4=B9=9F) wrote: > > On Fri, Aug 20, 2021 at 11:40:24AM -0700, Yang Shi wrote: > > On Thu, Aug 19, 2021 at 11:48 PM HORIGUCHI NAOYA(=E5=A0=80=E5=8F=A3=E3= =80=80=E7=9B=B4=E4=B9=9F) > > wrote: > > > > > > On Wed, Aug 18, 2021 at 10:41:16PM -0700, Yang Shi wrote: > > > > 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 disable= d and > > > > holding memory hotplug lock, it should be not a big deal since hwpo= ison > > > > handler is not called very often. > > > > > > > > Suggested-by: Matthew Wilcox > > > > Cc: Naoya Horiguchi > > > > Cc: Oscar Salvador > > > > Signed-off-by: Yang Shi > > > > --- > > > > mm/memory-failure.c | 3 +++ > > > > 1 file changed, 3 insertions(+) > > > > > > > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > > > > index 7cfa134b1370..60df8fcd0444 100644 > > > > --- a/mm/memory-failure.c > > > > +++ b/mm/memory-failure.c > > > > @@ -1228,6 +1228,9 @@ static int get_any_page(struct page *p, unsig= ned long flags) > > > > ret =3D -EIO; > > > > } > > > > out: > > > > + if (ret =3D=3D -EIO) > > > > + dump_page(p, "hwpoison: unhandlable page"); > > > > + > > > > > > I feel that 4 callers of get_hwpoison_page() are in the different con= text, > > > so it might be better to consider them separately to add dump_page() = or not. > > > soft_offline_page() still prints out "%s: %#lx: unknown page type: %l= x (%pGp)" > > > > No strong opinion to keep or remove it. > > Reading the explanation below, I think that calling dump_page() in the > original place is fine. So let's remove "else if (ret =3D=3D 0)" block i= n > soft_offline_page(). The "else if (ret =3D=3D 0)" block is used to handle free page IIUC. I'm supposed you mean the "else if (ret =3D=3D -EIO)" block which just calls printk. > > > > > > message, which might be duplicate so this printk() may be dropped. > > > In memory_failure_hugetlb() and memory_failure(), we can call dump_pa= ge() after > > > action_result(). unpoison_memory() doesn't need dump_page() at all b= ecause > > > it's related to already hwpoisoned page. > > > > I don't have a strong opinion either to have the dump_page() called > > either before action or after action, it just moves around the dumped > > page information around that printk. > > > > For unpoison_memory(), I think it is harmless to have dump_page() > > called, right? If get_hwpoison_page() can't return -EIO, then the > > dump_page() won't be called at all, if it is possible then this is > > exactly why we call dump_page() to help debug. > > > > So IMHO calling dump_page() in get_any_page when -EIO is returned > > could work for all the cases well and avoid duplicating the call. > > Fair enough. So could you repost 3/3 with the above change in soft_offlin= e_page()? > > Thanks, > Naoya Horiguchi