linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH v1 2/2] mm/memory-failure: send SIGBUS(BUS_MCEERR_AR) only to current thread
Date: Tue, 9 Jun 2020 02:29:20 +0000	[thread overview]
Message-ID: <20200609022919.GA28268@hori.linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <20200608221759.GA778@agluck-desk2.amr.corp.intel.com>

On Mon, Jun 08, 2020 at 03:17:59PM -0700, Luck, Tony wrote:
> On Fri, Jun 05, 2020 at 10:37:19AM +0900, Naoya Horiguchi wrote:
> > Action Required memory error should happen only when a processor is
> > about to access to a corrupted memory, so it's synchronous and only
> > affects current process/thread.  Recently commit 872e9a205c84 ("mm,
> > memory_failure: don't send BUS_MCEERR_AO for action required error")
> > fixed the issue that Action Required memory could unnecessarily send
> > SIGBUS to the processes which share the error memory. But we still have
> > another issue that we could send SIGBUS to a wrong thread.
> > 
> > This is because collect_procs() and task_early_kill() fails to add the
> > current process to "to-kill" list.  So this patch is suggesting to fix
> > it.  With this fix, SIGBUS(BUS_MCEERR_AR) is never sent to non-current
> > process/thread.
> 
> Does the new code now send SIGBUS(BUS_MCEERR_AO) to all the other threads
> of a multi-threaded process?

No, it doesn't. This patch should not change anything for Action Optional
case, and find_early_kill_thread() chooses one thread per process, so
SIGBUS(BUS_MCEERR_AO) (as well as SIGBUS(BUS_MCEERR_AR)) should be sent only
to the chosen thread.

- Naoya

> 
> It looks like it might (and I don't have some handy multi-threaded test
> case to try it out).
> 
> If it does, is that what we want?
> 
> -Tony
> 

  reply	other threads:[~2020-06-09  2:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  1:37 [PATCH v1 0/2] hwpoison: fixes signaling on memory error Naoya Horiguchi
2020-06-05  1:37 ` [PATCH v1 1/2] mm/memory-failure: prioritize prctl(PR_MCE_KILL) over vm.memory_failure_early_kill Naoya Horiguchi
2020-06-05  1:37 ` [PATCH v1 2/2] mm/memory-failure: send SIGBUS(BUS_MCEERR_AR) only to current thread Naoya Horiguchi
2020-06-08 22:17   ` Luck, Tony
2020-06-09  2:29     ` HORIGUCHI NAOYA(堀口 直也) [this message]
2020-06-09 16:30       ` Luck, Tony
2020-06-09 20:54   ` Pankaj Gupta
2020-06-05  1:46 ` [PATCH v1 0/2] hwpoison: fixes signaling on memory error HORIGUCHI NAOYA(堀口 直也)
2020-06-08  0:53   ` Andrew Morton
2020-06-08  2:25     ` 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=20200609022919.GA28268@hori.linux.bs1.fc.nec.co.jp \
    --to=naoya.horiguchi@nec.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=nao.horiguchi@gmail.com \
    --cc=tony.luck@intel.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