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,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 9E808C4338F for ; Fri, 20 Aug 2021 18:40:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 502F960F45 for ; Fri, 20 Aug 2021 18:40:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 502F960F45 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 E6A686B0072; Fri, 20 Aug 2021 14:40:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E1A5E6B0073; Fri, 20 Aug 2021 14:40:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE28B8D0001; Fri, 20 Aug 2021 14:40:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0079.hostedemail.com [216.40.44.79]) by kanga.kvack.org (Postfix) with ESMTP id B4F846B0072 for ; Fri, 20 Aug 2021 14:40:38 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6A5052D01F for ; Fri, 20 Aug 2021 18:40:38 +0000 (UTC) X-FDA: 78496324956.24.6028E5D Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by imf25.hostedemail.com (Postfix) with ESMTP id 1E4D3B000187 for ; Fri, 20 Aug 2021 18:40:37 +0000 (UTC) Received: by mail-ej1-f41.google.com with SMTP id gr13so22025802ejb.6 for ; Fri, 20 Aug 2021 11:40:37 -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=/pADhCAwK4juZlSCok3DDyAn5Ad9nUJgtlWKkYwI+sk=; b=vAQq/vD+bsbDkzsQULGgQqpeQC0mMft3dolayaH+xHjEkybfiHAGTLXOkL9M6cnjQE pir8v5NXo2LH48ydW5CKr+tC3us5e6+Ob5xvfIOsL1Wf2Ytmueq7BTZI0/xPCGhQbhMh xPo9kpJr37n3VvYt9UA7vOiVH4FcVaoF779fSZNQcNWJXZ7AAk7O6sQF5roQJBUmDzcW AawgC03D6DHXZeEO0D9GhoX0Xb/2BFbqlHo7R2XCeT+vR2IMQSvBQK8aj+q4b39mBN3Q jWxUC2onbIYHhfsqF5T1NnAhHmzYNjrEupa39m0Syh8+4+r9joYmgt1ofHTfsPC9OX3Y NdGw== 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=/pADhCAwK4juZlSCok3DDyAn5Ad9nUJgtlWKkYwI+sk=; b=gUwNueNW35nuFq6hAb6ZYbCvy/77gbBDpXseiRf867MRNCiZ8s1WGs32r81W3IOygZ zF6+fyzAQg8hCrrKbCkSMUb3tWnkyyp88cdkX+iwNtumBX0TUrt+2pAyPNV/nsAQw2m+ 8x5+AqMmmg/79al++/kpPEM3gfdlupL5n8LPwuTE22y7isz/FjhpdXEdxHs8rpxW7Qk/ T9csDIzeOLk96JJXzVtMdtL1JhMytirgmx6vhwctemYlso3Mcz3Aw92eTmmd2mQ4JgA/ vf2ji3dS9zWrBRc+y7P1e6WWkcVqilpHkXgW28g9Yf+CBw/XdWRNyQj/pyS+aPDwBjx4 cdTg== X-Gm-Message-State: AOAM532LhyavUgdkZsgGQrg5np7DgIvJANTufz0kHG+M7waKqHJhXh7S 4aJ47BkJdfXH9ZL0scnm75gu1KnLGGGT15sS5Tk= X-Google-Smtp-Source: ABdhPJwTMcz2avAdDQjv2GkXNUDYA5UHkWh/wkFD/3mVmF+6EPjnMOVFSJHsUz8E0U05BhKQc5KeuFkKYgKU57uPtFI= X-Received: by 2002:a17:906:1f82:: with SMTP id t2mr22806105ejr.499.1629484836571; Fri, 20 Aug 2021 11:40:36 -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> In-Reply-To: <20210820064832.GA63355@hori.linux.bs1.fc.nec.co.jp> From: Yang Shi Date: Fri, 20 Aug 2021 11:40:24 -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: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="vAQq/vD+"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf25.hostedemail.com: domain of shy828301@gmail.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Stat-Signature: fogusmzbkso7modafotmsh89qei759wy X-Rspamd-Queue-Id: 1E4D3B000187 X-Rspamd-Server: rspam05 X-HE-Tag: 1629484837-789489 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 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 sho= w > > more useful information. > > > > Calling dump_page() in get_any_page() in order to not duplicate the cal= l > > in a couple of different places. It may be called with pcp disabled an= d > > 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 > > --- > > 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, unsigned = 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 context= , > so it might be better to consider them separately to add dump_page() or n= ot. > soft_offline_page() still prints out "%s: %#lx: unknown page type: %lx (%= pGp)" No strong opinion to keep or remove it. > message, which might be duplicate so this printk() may be dropped. > In memory_failure_hugetlb() and memory_failure(), we can call dump_page()= after > action_result(). unpoison_memory() doesn't need dump_page() at all becau= se > 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. > > Thanks, > Naoya Horiguchi