Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp169155iog; Tue, 14 Jun 2022 22:55:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tcztHK/rmZOvA5QySiFF/0lA3IYPVJclarrKZtQJ6aQNsLczvd+PVOgc6zqvsS71lZEmKL X-Received: by 2002:a17:90b:503:b0:1e2:f129:5135 with SMTP id r3-20020a17090b050300b001e2f1295135mr8295959pjz.22.1655272557042; Tue, 14 Jun 2022 22:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655272557; cv=none; d=google.com; s=arc-20160816; b=Dm6a255/HVMKz3/8+IrXRHFhnWPeMfd+gzoyBRGCc9EutXpjGZPN4+KBVJNDXGaV/4 fXCjsGFWj1FtOsb+rylMUXLmCPfyYiJ1IeZ1QkEBe2snvGNI/XNf519qMkEMVVvO+QS3 qLnS3ZlHzz5tzyhEWA0mLDx56H8yBv4FeXeGcQ5qHEd2gOE2gdZ4G35eUiLTXsBekAJL guiLdAMCJyJdZwiIAeFpACsX03a+91IJkdxXF+E1R6GDoz83ATZEc9mXTshqa/xRTE3W RpA3lffA8DzfoUH74y3xiHACOqJ8u95avS+Rru5QjrO+wc21jFs4AHiM2KXU+NllIP9i fwOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=v/x4ZySKfHwpoxJoLmQ6/CEe5d9dpWm2UprmRWYwfdk=; b=R5m+UwcRbjHVsa5tPuuBk0E9I4nQfBAQTNLLiDFYC3kdTarqQwKcoaxJooq/RS7FIi h479Fbt6QRqGG8fRZIAZUytKI2QUSeqU+pppxo+JLivgkdWFJDsYIxdMpnBovz3lHmSe Zho/mF8SfwMYyLBARKaP1qW5n2EaWMvj1bzLG+EWedatKwpMI1V/dQBM1Rbn99M6wmnw opk/wRwCMUtfmLOaR8xvrcIRYhHbP2jfamdZMjutvIhNZveqqzkwIg+p7mgOleDE3bhZ R9QbzT6pn04dQcYzpIFZfjkOKMDsuN2ix2GeyZj41DMwH2+quk/fGgRk6MXor72ff2RN FfUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tTf8FArW; dkim=neutral (no key) header.i=@suse.de; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 26-20020a63165a000000b003fe30cc898bsi15268733pgw.664.2022.06.14.22.55.44; Tue, 14 Jun 2022 22:55:57 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tTf8FArW; dkim=neutral (no key) header.i=@suse.de; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238646AbiFOFwN (ORCPT + 99 others); Wed, 15 Jun 2022 01:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234635AbiFOFwK (ORCPT ); Wed, 15 Jun 2022 01:52:10 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E42D7237C3 for ; Tue, 14 Jun 2022 22:52:09 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2BFB21F8F7; Wed, 15 Jun 2022 05:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655272328; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v/x4ZySKfHwpoxJoLmQ6/CEe5d9dpWm2UprmRWYwfdk=; b=tTf8FArWBTRRcFiGPusJuPgESG0J0pohqhiqMl5mo1rDGn6qXyD7wtBFk4sNKguyJIPEpo f0+tSq6/mI/MIqEMamN5PLarhTkSiCEo6nAxSk3UjOxDRrPkrUqmsfPGy662H1FcLVbM2i 3Kwd6g50d2o6X5hoI9l4/+uuW7H/cJQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655272328; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v/x4ZySKfHwpoxJoLmQ6/CEe5d9dpWm2UprmRWYwfdk=; b=eA+EsViOVx0+KXG5OotvslK7j1lZSX6mympWHW0HPBvU9zmQsflTXBY9Z5r4yKmpeyvpqo sSzZ1ERs5Cz7VUDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A7486139EC; Wed, 15 Jun 2022 05:52:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WfQEJodzqWKeYgAAMHmgww (envelope-from ); Wed, 15 Jun 2022 05:52:07 +0000 Date: Wed, 15 Jun 2022 07:52:06 +0200 From: Oscar Salvador To: zhenwei pi Cc: naoya.horiguchi@nec.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@redhat.com, linmiaohe@huawei.com, gregkh@linuxfoundation.org Subject: Re: Re: [PATCH v5 1/1] mm/memory-failure: disable unpoison once hw error happens Message-ID: References: <20220615020005.246295-1-pizhenwei@bytedance.com> <20220615020005.246295-2-pizhenwei@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Wed, Jun 15, 2022 at 01:18:23PM +0800, zhenwei pi wrote: > Hi, > > Because memory_failure() may be called by hardware error randomly, > hw_memory_failure should be protected by mf_mutex to avoid this case: > int unpoison_memory(unsigned long pfn) > { > ... > if (hw_memory_failure) { > } > ... --> memory_failure() happens, and mark hw_memory_failure as true > mutex_lock(&mf_mutex); Yeah, I am aware of that. But once memory_failure() sets hw_memory_failure to true, it does not really matter whether unpoison_memory() checks that while holding or not the lock, does it? Note that it does not really matter in the end, but I am just curious whether there is any strong impediment to that. -- Oscar Salvador SUSE Labs