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 A5A91C433EF for ; Tue, 14 Jun 2022 07:13:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 115678D0212; Tue, 14 Jun 2022 03:13:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 09E1A8D0210; Tue, 14 Jun 2022 03:13:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E592F8D0212; Tue, 14 Jun 2022 03:13:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CFAE68D0210 for ; Tue, 14 Jun 2022 03:13:21 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 9430E1212CC for ; Tue, 14 Jun 2022 07:13:21 +0000 (UTC) X-FDA: 79575975402.03.A30851A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 00B26400A8 for ; Tue, 14 Jun 2022 07:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655190800; h=from:from: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=LKlOpt8qSD0CmMZjWRzdbcAIzpT8dnJiO5KsKOkq/7A=; b=Dsy+hVDt0Q/U7b8EXXyZ0FitvOX6FVjKHUIQb5uWnXxyBNfOLS8Z9G/KJKZ7PmWaIpeRoj RD2qcOZQcJZ1Ob8uvsqU5Sjv69PxN4zfR1hJkendxThkVeYnjBS++kev5A6cPffDy3d9Xt Yzcf3SGZ90dWmaKrRq36+rCFRjsalzE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-575-cBWdv-KENB-rQdspuwEhyw-1; Tue, 14 Jun 2022 03:13:19 -0400 X-MC-Unique: cBWdv-KENB-rQdspuwEhyw-1 Received: by mail-wr1-f70.google.com with SMTP id e9-20020a5d5949000000b00216ffb6df18so1005869wri.14 for ; Tue, 14 Jun 2022 00:13:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=LKlOpt8qSD0CmMZjWRzdbcAIzpT8dnJiO5KsKOkq/7A=; b=BJC3YWnboNQEaIGfErWWVg3q4Tg1BZFxIM+zAb3L+kom9cN5C76BHLERaG4Wuy2/Ap vD+0sSteBClzXZfwQonm1WW0WSrGxedEfVYJyu5e7RdCc9b2oLCtIlWtfN4+0PwiByjz 3uknUcddhU9gCmkJxtA6iVy6unmvQwHog6ovB1xAKMC0VHeNRl4eXQ6BSZSB7nQwWF6R 7SC82uhKWD7qAQtCYj2jgcdvDEScqJ2B27pRLUzT7aou7vn++BquAvBUBBJhhquGGejr FyX7Ip0OTh5hL1vqnCydlYIoZelVgQ+uZwjanbO70GX3c/GlUx0II+uS1zZHlphzvVcE /PsQ== X-Gm-Message-State: AJIora//GYXLOiNTXFCDeslZPyfB3kFfBgrB6iImW3+aRBahJNl1EuRJ DDS9uK9Y6/44S0HW4RpuZg4ijp8xgI1aOeCVMHGdRpjoXKBU1wABD8sX7KMpCh8eDneFoBOCTZq +IzLIV7E2zRc= X-Received: by 2002:adf:e488:0:b0:20f:d981:4b42 with SMTP id i8-20020adfe488000000b0020fd9814b42mr3418604wrm.455.1655190798191; Tue, 14 Jun 2022 00:13:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sgovKaDqFV8QpEkIw4k+j83HoLwRExh4nSqw3y81ZcWHWy4RxHq503W6SY/MetIN7pvGyF+w== X-Received: by 2002:adf:e488:0:b0:20f:d981:4b42 with SMTP id i8-20020adfe488000000b0020fd9814b42mr3418591wrm.455.1655190797985; Tue, 14 Jun 2022 00:13:17 -0700 (PDT) Received: from ?IPV6:2003:cb:c70b:cf00:aace:de16:d459:d411? (p200300cbc70bcf00aacede16d459d411.dip0.t-ipconnect.de. [2003:cb:c70b:cf00:aace:de16:d459:d411]) by smtp.gmail.com with ESMTPSA id f6-20020a05600c4e8600b0039c6ce32a2dsm18645125wmq.33.2022.06.14.00.13.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jun 2022 00:13:17 -0700 (PDT) Message-ID: <66c43dac-32ac-5801-c76c-01607d68e38b@redhat.com> Date: Tue, 14 Jun 2022 09:13:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v4 1/2] mm/memory-failure: introduce "hwpoisoned-pages" entry To: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , zhenwei pi Cc: "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "linmiaohe@huawei.com" References: <20220614043830.99607-1-pizhenwei@bytedance.com> <20220614043830.99607-2-pizhenwei@bytedance.com> <20220614070934.GA1627546@hori.linux.bs1.fc.nec.co.jp> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220614070934.GA1627546@hori.linux.bs1.fc.nec.co.jp> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655190801; a=rsa-sha256; cv=none; b=tSb6iGxcTqx+PjG9TD+klNg11Oy5HMLmX/ZO8sG/DSPY1l+tAgeQ0LZmnpyZnWxzlz5gss KzG6ljvsqHZN+zYldmYwIVKlx9WVcPufZ/EB8gCgRpJCTV1QjX/1q+LHKlU1l09aa3nR/K X9+QkPFx5HhfoNHTowgA2BBAZE6R6M4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Dsy+hVDt; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf12.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655190801; 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:dkim-signature; bh=LKlOpt8qSD0CmMZjWRzdbcAIzpT8dnJiO5KsKOkq/7A=; b=WKNK6DPUWimQxp1ydeB2qa9+BKrixb53lQwTq7PzmKoOMPVJko/a+5pFhPATWNehtpSpcA E+fo3dijqmgwsetcx1RRJXeNgcVK2xuEZerMrakD4Bi0usojjXaw9wOcXE7NTsz/hVubAx rqiSJaZHUYLbyzc1/3v7hNtA83dNLuk= X-Rspamd-Queue-Id: 00B26400A8 X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Dsy+hVDt; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf12.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam06 X-Stat-Signature: 7g6gn4j38ymbqubbenhnpras8akjygdr X-HE-Tag: 1655190800-616979 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: &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. -- Thanks, David / dhildenb