Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1224511iog; Tue, 14 Jun 2022 01:37:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tK/gca9Sbr9x1CQqyRpchb7gn0DwcrZrD7d4Igq98M9lhvOkBTI1vbGPAYIWPoWXXclacs X-Received: by 2002:a17:90b:1117:b0:1ea:58d2:85d3 with SMTP id gi23-20020a17090b111700b001ea58d285d3mr3355161pjb.167.1655195879064; Tue, 14 Jun 2022 01:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655195879; cv=none; d=google.com; s=arc-20160816; b=zRjFn7FH3KlnOfAWtG8PMgFFfbo2N9ELniRs65xYfWgS1r38bp4WDdOnpb6/SjI3l/ V48mYAvfU9yZyT/bLIAASL54TbwQ6tHlWUY/dt9nBzhRUfNsmD+W9qTwHDxsDtp+i/M6 3P74BcwFJgcq514mzOK6M1rSoKAnnBYGOaPd5zI3Gc0e7SOcEdCQ24rh97r+YvckiVpg W85q5LeYH4+ujrfI379qSg+klMyhtslaqrsk2HcmTF2qqhcwE5rr220xLQyHFOdM06QO P+zNxwiq61iyj4L5ptX6nvQCTmqp/3r7ZTV+qqn08Y/zJdOBcgb7br/rVOdzqVRmg5Af +cvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=pAn23O9K+CYiRhoL76cAYCe6LFk1Fg0UBdv99X7NBnw=; b=SGAKg4jSWJC5YEvRGtzaA26vj9fEmhDYHYr9c+mKig4OJu5iFegThCXK5+xLxwiJe6 rYqltTj+Q28tGDAg9AxZ0iSixP5cZXbPMJut6/ZyGAAvwjLqf3K9/ohXM4Ny7A6OrDKD +mlhewrH4XATlYjKOW26xd9ntQfGdTgLsI1Ug8OtaMkMsLadYfVbDizphU3XrQX/UAys TqHaMWVNqi67hXO7hgDDnBscSisAPMACIxvWFzaB1Vq+DFmT1MRMsKIguyIlfKMFHAxE 0/BDiz+DA8UtdF/1n+iPDGkfBOpXxVWfDY+SX2iioJZZXw9oKRGJCUJp42+tekOof6Nd FRGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a056a000ac400b0050d932fc7b4si13669402pfl.185.2022.06.14.01.37.46; Tue, 14 Jun 2022 01:37:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238690AbiFNITc (ORCPT + 99 others); Tue, 14 Jun 2022 04:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235690AbiFNITa (ORCPT ); Tue, 14 Jun 2022 04:19:30 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6133D403D4 for ; Tue, 14 Jun 2022 01:19:29 -0700 (PDT) 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 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. ;) >