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=-4.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no 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 BA9E1C433E0 for ; Tue, 2 Mar 2021 04:32:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D797560202 for ; Tue, 2 Mar 2021 04:32:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D797560202 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kingsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 495468D00DC; Mon, 1 Mar 2021 23:32:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 420658D0063; Mon, 1 Mar 2021 23:32:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E73B8D00DC; Mon, 1 Mar 2021 23:32:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 14C5C8D0063 for ; Mon, 1 Mar 2021 23:32:22 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D2DBA8249980 for ; Tue, 2 Mar 2021 04:32:21 +0000 (UTC) X-FDA: 77873662482.11.80408ED Received: from mail.kingsoft.com (mail.kingsoft.com [114.255.44.145]) by imf05.hostedemail.com (Postfix) with ESMTP id 47709E0011D2 for ; Tue, 2 Mar 2021 04:32:13 +0000 (UTC) X-AuditID: 0a580157-f39ff7000005df43-4d-603db95d708e Received: from mail.kingsoft.com (localhost [10.88.1.32]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.kingsoft.com (SMG-1-NODE-87) with SMTP id 50.37.57155.D59BD306; Tue, 2 Mar 2021 12:04:45 +0800 (HKT) Received: from alex-virtual-machine (172.16.253.254) by KSBJMAIL2.kingsoft.cn (10.88.1.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 2 Mar 2021 12:32:07 +0800 Date: Tue, 2 Mar 2021 12:32:07 +0800 From: Aili Yao To: "Luck, Tony" CC: Oscar Salvador , "HORIGUCHI =?UTF-8?B?TkFPWUE=?=( =?UTF-8?B?5aCA5Y+j44CA55u05Lmf?=)" , "david@redhat.com" , "akpm@linux-foundation.org" , "bp@alien8.de" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "yangfeng1@kingsoft.com" , Subject: Re: [PATCH] mm,hwpoison: return -EBUSY when page already poisoned Message-ID: <20210302123207.0217e5c4@alex-virtual-machine> In-Reply-To: <20210226175837.GA184397@agluck-desk2.amr.corp.intel.com> References: <20210224151619.67c29731@alex-virtual-machine> <20210224103105.GA16368@linux> <20210225114329.4e1a41c6@alex-virtual-machine> <20210225112818.GA10141@hori.linux.bs1.fc.nec.co.jp> <20210225113930.GA7227@localhost.localdomain> <20210226105250.3a15e35c@alex-virtual-machine> <20210226175837.GA184397@agluck-desk2.amr.corp.intel.com> Organization: kingsoft X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.253.254] X-ClientProxiedBy: KSBJMAIL1.kingsoft.cn (10.88.1.31) To KSBJMAIL2.kingsoft.cn (10.88.1.32) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRmVeSWpSXmKPExsXCFcGooBu70zbBYF67gMWc9WvYLD5v+Mdm 8XX9L2aLaRvFLS6camCyuLxrDpvFvTX/WS0uHVjAZHGx8QCjxZlpRRabN01ltnhz4R6LxY8N j1kdeD2+t/axeCze85LJY9OqTjaPTZ8msXu8O3eO3ePEjN8sHi+ubmTxeL/vKpvH5tPVHp83 yXmcaPnCGsAdxWWTkpqTWZZapG+XwJXxd9EVtoI93BX7Pps3MH7i6GLk5JAQMJF4PmElcxcj F4eQwHQmiZ5b75lBEkICLxkllm8oBLFZBFQk9nUtZwex2QRUJXbdm8UKYosIqElcWvwArJlZ YA6rxNeZ85lAEsICXhJf7q9lBLF5BawkVkx5B2ZzCrhJnN71kR1i2wMmiV3HZ4Nt4xcQk+i9 8p8J4iR7ibYti6CaBSVOznzCAmIzC+hInFh1jBnClpfY/nYO1KWKEoeX/GKH6FWSONI9gw3C jpVYNu8V6wRG4VlIRs1CMmoWklELGJlXMbIU56YbbmKExF/4DsZ5TR/1DjEycTAeYpTgYFYS 4T352TJBiDclsbIqtSg/vqg0J7X4EKM0B4uSOK+wi02CkEB6YklqdmpqQWoRTJaJg1OqgWn7 LKVHvm81N8i2/b3hO9VHdcaT1MuaXwoMp1z1spd5c8nzWCOHqMRR+8X3nObyqPcJHzfN+7iG UchHe+WMgwuS8n7xJ0k9zrpwb0r/ygoXrxWr2T5d0vLO+H33dkTAl/XFhyy1Mq7Jfq4+oFG6 cUqeNpeXfEtiOnOq/5Ubff6cVWK/43aIR9p5+Sqs3vyHq/d9tV1UwRKPuYu3l8pOWZSp072z +rlZxHrXHN+Hj2sll8Ul3L+zmbs38kXvrvSenc/2NNS8kb2bsrH8hqACy+qsV2+uCKz5X3o/ VzQu+Mi+7iPOJ5c8XROjl+DWKdFzQdl7wfy5wkWvVeY0/nRqc3A7YtXemlbOcGcO6xPFMCWW 4oxEQy3mouJEAGhR4eguAwAA X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 47709E0011D2 X-Stat-Signature: f1omx4zisah1z9mi3thwdugbh7z1w38r Received-SPF: none (kingsoft.com>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=mail.kingsoft.com; client-ip=114.255.44.145 X-HE-DKIM-Result: none/none X-HE-Tag: 1614659533-645473 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000053, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 26 Feb 2021 09:58:37 -0800 "Luck, Tony" wrote: > On Fri, Feb 26, 2021 at 10:52:50AM +0800, Aili Yao wrote: > > Hi naoya,Oscar,david: > > > > > > > We could use some negative value (error code) to report the reported case, > > > > then as you mentioned above, some callers need change to handle the > > > > new case, and the same is true if you use some positive value. > > > > My preference is -EHWPOISON, but other options are fine if justified well. > > > > > > -EHWPOISON seems like a good fit. > > > > > I am OK with the -EHWPOISON error code, But I have one doubt here: > > When we return this -EHWPOISON error code, Does this means we have to add a new error code > > to error-base.h or errno.h? Is this easy realized? > > The page already poisoned isn't really an error though. Just the result > of a race condition. What if we added an extra argument to memory_failure() > so it can tell the caller that the specific reason for the early successful > return is that the page was already poisoned? > It may be not an error, Is it reasonable to return a positive value like MF_HWPOISON, it seems the 0 return code donesn't tell the whole story. Your patch seems more safer, But I don't know if it's worth such multi module modifications for this case. It really should be referenced to other maintainers and reviewers and thet can give more expert suggestions. Thanks! Aili Yao