From: Shiyang Ruan <ruansy.fnst@fujitsu.com>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: linux-cxl@vger.kernel.org, linux-edac@vger.kernel.org,
linux-mm@kvack.org, dan.j.williams@intel.com,
vishal.l.verma@intel.com, alison.schofield@intel.com,
bp@alien8.de, dave.jiang@intel.com, dave@stgolabs.net,
ira.weiny@intel.com, james.morse@arm.com, linmiaohe@huawei.com,
mchehab@kernel.org, nao.horiguchi@gmail.com, rric@kernel.org,
tony.luck@intel.com, shiju.jose@huawei.com
Subject: Re: [PATCH v4 1/2] cxl/core: introduce device reporting poison hanlding
Date: Mon, 2 Sep 2024 22:03:03 +0800 [thread overview]
Message-ID: <05811930-8fa9-42f8-8034-6f0945b103fc@fujitsu.com> (raw)
In-Reply-To: <20240827164610.00002f4d@Huawei.com>
在 2024/8/27 23:46, Jonathan Cameron 写道:
> On Thu, 8 Aug 2024 23:13:27 +0800
> Shiyang Ruan <ruansy.fnst@fujitsu.com> wrote:
>
>> CXL device can find&report memory problems, even before MCE is detected
>> by CPU. AFAIK, the current kernel only traces POISON error event
>> from FW-First/OS-First path, but it doesn't handle them, neither
>> notify processes who are using the POISON page like MCE does.
>>
>> Thus, user have to read logs from trace and find out which device
>> reported the error and which applications are affected. That is not
>> an easy work and cannot be handled in time.
>
> These are async reports, so I'm not sure what 'in time' really means here.
'in time' may not be appropriate. I think 'ASAP' is better. I just
want to say: comparing with users finding out the errors from trace logs
and notifying apps manually, kernel handler can do that automatically
and ASAP.
> If we get synchronous poison from a processor access it will be handled
> via traditional means (MCE, ARM SEA etc)
Yes. For FW-First path, MCE mechanism can cover this. But for OS-First
path, errors can only be traced, then logged by userspace tool like
rasdaemon. We hope in OS-First path, kernel can handle it like MCE does
too.
>
> Whether to handle async error reports (typically from scrub or because
> the memory device received poison from someone else) the same way
> should perhaps be a policy decision. It should match what we do
> for firmware first async reports though (any policy controls make sense
> for both).
Yes. In OS-First path, I think it should always be turned on.
>
> An example of this would be that an host OS might attempt a polite close
> of an application might attempt a polite if we know there is poison
> somewhere in a dataset it has access to. If that poison is never seen
> synchronously (because that data is not read) then it my close
> successfully rather than being killed.
According to kernel docs for 'early kill' of memory-failure, I think
it's suitable for this case.
>
> If it's injected poison and we didn't see it synchronously we might
> well not want to kill anything.
Agree. Injection APIs are used for debugging, not a really HW poison.
>
>> Thus, it is needed to add
>> the feature to make the work done automatically and quickly. Once CXL
>> device reports the POISON error (via FW-First/OS-First), kernel
>> handles it immediately, similar to the flow when a MCE is triggered.
>>
>> The current call trace of error reporting&handling looks like this:
>> ```
>> 1. MCE (interrupt #18, while CPU consuming POISON)
>> -> do_machine_check()
>> -> mce_log()
>> -> notify chain (x86_mce_decoder_chain)
>> -> memory_failure()
>>
>> 2.a FW-First (optional, CXL device proactively find&report)
>> -> CXL device -> Firmware
>> -> OS: ACPI->APEI->GHES->CPER -> CXL driver -> trace
>> \-> memory_failure()
>> ^----- ADD
>> 2.b OS-First (optional, CXL device proactively find&report)
>> -> CXL device -> MSI
>> -> OS: CXL driver -> trace
>> \-> memory_failure()
>> ^------------------------------- ADD
>> ```
>> This patch adds calling memory_failure() while CXL device reporting
>> error is received, marked as "ADD" in figure above.
>
> Typo in patch title. handling
Thanks.
> I've also dropped qemu-devel as this doesn't have anything to do with qemu.
>
OK.
>>
>> Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
>
> Experienced RAS folk in the CC, how do you want this to work for
> asynchoronous memory errors on CXL devices?
>
>
next prev parent reply other threads:[~2024-09-02 14:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 15:13 [PATCH v4 0/2] cxl: add device reporting poison handler Shiyang Ruan
2024-08-08 15:13 ` [PATCH v4 1/2] cxl/core: introduce device reporting poison hanlding Shiyang Ruan
2024-08-08 18:28 ` Fan Ni
2024-08-21 13:57 ` Shiyang Ruan
2024-08-27 15:46 ` Jonathan Cameron
2024-09-02 14:03 ` Shiyang Ruan [this message]
2024-08-08 15:13 ` [PATCH v4 2/2] cxl: avoid duplicated report from MCE & device Shiyang Ruan
2024-08-09 7:31 ` kernel test robot
2024-08-09 7:31 ` kernel test robot
2024-08-09 11:48 ` kernel test robot
2024-08-27 15:52 ` Jonathan Cameron
2024-09-02 14:19 ` Shiyang Ruan
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=05811930-8fa9-42f8-8034-6f0945b103fc@fujitsu.com \
--to=ruansy.fnst@fujitsu.com \
--cc=Jonathan.Cameron@Huawei.com \
--cc=alison.schofield@intel.com \
--cc=bp@alien8.de \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=james.morse@arm.com \
--cc=linmiaohe@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mchehab@kernel.org \
--cc=nao.horiguchi@gmail.com \
--cc=rric@kernel.org \
--cc=shiju.jose@huawei.com \
--cc=tony.luck@intel.com \
--cc=vishal.l.verma@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