From: Oscar Salvador <osalvador@suse.de>
To: zhenwei pi <pizhenwei@bytedance.com>
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
Date: Wed, 15 Jun 2022 07:52:06 +0200 [thread overview]
Message-ID: <YqlzhlrjJhqvUV4I@localhost.localdomain> (raw)
In-Reply-To: <dbe19d10-beb1-bbdc-7935-3e1cfa46e3e8@bytedance.com>
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
next prev parent reply other threads:[~2022-06-15 5:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 2:00 [PATCH v5 0/1] mm/memory-failure: don't allow to unpoison hw corrupted page zhenwei pi
2022-06-15 2:00 ` [PATCH v5 1/1] mm/memory-failure: disable unpoison once hw error happens zhenwei pi
2022-06-15 4:23 ` Oscar Salvador
2022-06-15 5:18 ` zhenwei pi
2022-06-15 5:52 ` Oscar Salvador [this message]
2022-06-15 7:39 ` HORIGUCHI NAOYA(堀口 直也)
2022-06-15 8:15 ` HORIGUCHI NAOYA(堀口 直也)
2022-06-15 8:21 ` David Hildenbrand
2022-06-15 8:43 ` HORIGUCHI NAOYA(堀口 直也)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YqlzhlrjJhqvUV4I@localhost.localdomain \
--to=osalvador@suse.de \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=naoya.horiguchi@nec.com \
--cc=pizhenwei@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).