Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1701050pxb; Fri, 20 Aug 2021 11:42:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeVhVfHlHyr/EN0augqldjDdEYfNShOoY98MWoOSNus/PFxJitIu8bMQdkmUG3uaijPSP2 X-Received: by 2002:a05:6402:1a45:: with SMTP id bf5mr23719299edb.169.1629484949986; Fri, 20 Aug 2021 11:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629484949; cv=none; d=google.com; s=arc-20160816; b=LNUZ4TbQOlph71LgfPrPBeHOD9UwuL1GaEIkneI6tL5ibfgq1NIXQ0Ip3TUPOoUOhG sEZnBLqxj44SJT2V4iFSV6DLy1e7eKzgSxPszMDsUrK7zXiWXntg4OkIST2vkJ7lWt3w C2rMfxH9eTfGjctxM5gX2Rov/FT7fz8Q02JX1gX5L4hqx0RXFFcxQKzab7IuS9juwcp7 ifdzK3Jmfh/SY2BaFS2qJAq4UZNutgbVwXXPhf+QJnz4vEJVTMdWrS58SWibCpGyTFfg akJXdWct9PwD1RkkTkNiL9RDnLS01u7Kl1m2Ce8EYij7rmbWLFGCp5kvXgelvCsnuU6S w+EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/pADhCAwK4juZlSCok3DDyAn5Ad9nUJgtlWKkYwI+sk=; b=PVw5FhEQvr8Zqg0wiA0QAGini9k76/HFoUPTKL7pvvKpBsQQfjBkcSIY1Uzmdp9kkB 0z3goZdJj3mOc3Pjdfkp/x7dJijVjcRVRRINB+FN3FoDR/Yy8yMHqtVL1xmJ4PFiuNf3 ITWLCvldp53S/HQQx7U0Ine6O7Lrps3dRaszLMpLVgvhBradxpBn4mT9COjLKW+cKS6w Wpy8Txb3DczuM6k5FjBqp8sPnSpyUNYL9vMtxrRXfaNor0QH9fXQwtEGXj4RkXFwGUFM 57xx+qnwPF+AYH3u/pui62PJlVmbBfoww70Bw8/eIQ7LrGRjHe97UJU4t8rUOYxTRiTQ CoZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="vAQq/vD+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd5si3904248ejc.375.2021.08.20.11.42.05; Fri, 20 Aug 2021 11:42:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="vAQq/vD+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237341AbhHTSlQ (ORCPT + 99 others); Fri, 20 Aug 2021 14:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236398AbhHTSlQ (ORCPT ); Fri, 20 Aug 2021 14:41:16 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1189EC061575 for ; Fri, 20 Aug 2021 11:40:38 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id b15so21942185ejg.10 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=m3fwPWWQ4i2dCxj/i7bz10rQanONDOczr1LsQh6U9V3DezDRkYysrAwIXD0hC07gvu f6ueqE6hzk8n2nG+KVQnvgdcqNkVwITRYFnatUGAoE7qj1E05zx0+WRUPJsWePnRqjqb AgJYUrC0Xd+1eCPQsH2r+TsoLCvziBXtDHFAvxZhtQYubSTIbmilj3TGv69+hqJitpzB T47CbegCok3qExLb3SHtv/D9YySIZbwHnB5w3LBbWA+XN7c2z6NLgtWmqxUwmA0PB8xy ULfF1itVPeroQCHIRHhThmzPTpLgRt1iz28Er8H6LUz26FHgNqn9flZAbgGWPoZYs0dx 1xfQ== X-Gm-Message-State: AOAM530PYPLJdiKyBYorG6+ZD1gl2E816IRRWhlNiEprsq7LepxMCTjC u2NqWMwidtatJDE59RkBlMj1i/dHj/0bxBGm+xA= 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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