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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D98EC43334 for ; Tue, 14 Jun 2022 08:19:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F38518D022E; Tue, 14 Jun 2022 04:19:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE74D8D0229; Tue, 14 Jun 2022 04:19:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E07CE8D022E; Tue, 14 Jun 2022 04:19:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D02828D0229 for ; Tue, 14 Jun 2022 04:19:32 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A8CAC21020 for ; Tue, 14 Jun 2022 08:19:32 +0000 (UTC) X-FDA: 79576142184.29.0D6DCEC Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf08.hostedemail.com (Postfix) with ESMTP id 29C60160004 for ; Tue, 14 Jun 2022 08:19:30 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LMhBM067Pz1K9SW; Tue, 14 Jun 2022 16:17:31 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 14 Jun 2022 16:19:26 +0800 Subject: Re: [PATCH v4 1/2] mm/memory-failure: introduce "hwpoisoned-pages" entry To: David Hildenbrand , =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= CC: "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , zhenwei pi References: <20220614043830.99607-1-pizhenwei@bytedance.com> <20220614043830.99607-2-pizhenwei@bytedance.com> <20220614070934.GA1627546@hori.linux.bs1.fc.nec.co.jp> <66c43dac-32ac-5801-c76c-01607d68e38b@redhat.com> From: Miaohe Lin Message-ID: Date: Tue, 14 Jun 2022 16:19:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <66c43dac-32ac-5801-c76c-01607d68e38b@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655194772; a=rsa-sha256; cv=none; b=bGoX+E6naUexIOq/hsI16+trn0FzR5hBWLySWMDe5prfVLBotry+50X4xvJu0dpX9SOvjb N0Yy22xH/M+qG54c2eYvy8alT7ntmDpwVnyeAyKoB4CQ3gn714sBrV9Y4nyiMcW5JJX47Q uCrDEzsyZu1gz5IV46EbWt3Y+mFlATM= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655194772; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pAn23O9K+CYiRhoL76cAYCe6LFk1Fg0UBdv99X7NBnw=; b=tk/DiMdgy0M70xXoV2bGLhi8o3ScQvSA720S34olZPH0SdzMI7Ikc5H85lGAXD0p+SPgkT tjEukQ7YjsSEVIz4XmfHka6CDD3fRqcC4ilJH4G9tLeNYMsQnpWLp0NXWjDCqJvu3uhCFi lb0OfXQfNw9GdeDMTBUy83ePo6mfN9o= X-Stat-Signature: 1qph17h4ntjgrxkzdmwh3rawdsfiiukm X-Rspamd-Queue-Id: 29C60160004 Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam07 X-Rspam-User: X-HE-Tag: 1655194770-161689 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 2022/6/14 15:13, David Hildenbrand wrote: > &hwpoisoned_pages); >> >> I'm not sure how useful this interface from userspace (controlling test process >> with this?). Do we really need to expose this to userspace? >> >> >> TBH I feel that another approach like below is more desirable: >> >> - define a new flag in "enum mf_flags" (for example named MF_SW_SIMULATED), >> - set the flag when calling memory_failure() from the three callers >> mentioned above, >> - define a global variable (typed bool) in mm/memory_failure.c_to show that >> the system has experienced a real hardware memory error events. >> - once memory_failure() is called without MF_SW_SIMULATED, the new global >> bool variable is set, and afterward unpoison_memory always fails with >> -EOPNOTSUPP. > > Exactly what I had in mind. This approach should be more straightforward. ;) >