linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Jiaqi Yan <jiaqiyan@google.com>, <tony.luck@intel.com>,
	<naoya.horiguchi@nec.com>
Cc: <duenwen@google.com>, <rientjes@google.com>, <linux-mm@kvack.org>,
	<shy828301@gmail.com>, <akpm@linux-foundation.org>
Subject: Re: [PATCH v2 2/3] mm: memory-failure: Bump memory failure stats to pglist_data
Date: Thu, 2 Feb 2023 14:56:15 +0800	[thread overview]
Message-ID: <ad4de896-bec4-e2c3-922d-ca5500d3a78d@huawei.com> (raw)
In-Reply-To: <20230120034622.2698268-3-jiaqiyan@google.com>



On 2023/1/20 11:46, Jiaqi Yan wrote:
> Right before memory_failure finishes its handling, accumulate poisoned
> page's resolution counters to pglist_data's memory_failure_stats, so as
> to update the corresponding sysfs entries.
> 
> Tested:
> 1) Start an application to allocate memory buffer chunks
> 2) Convert random memory buffer addresses to physical addresses
> 3) Inject memory errors using EINJ at chosen physical addresses
> 4) Access poisoned memory buffer and recover from SIGBUS
> 5) Check counter values under
>     /sys/devices/system/node/node*/memory_failure/*
> 
> Acked-by: David Rientjes <rientjes@google.com>
> Signed-off-by: Jiaqi Yan <jiaqiyan@google.com>
> ---
>   mm/memory-failure.c | 36 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 36 insertions(+)
> 
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index c628f1db3a4d..f4990839ea66 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1227,6 +1227,39 @@ static struct page_state error_states[] = {
>   #undef slab
>   #undef reserved
>   
> +static void update_per_node_mf_stats(unsigned long pfn,
> +				     enum mf_result result)
> +{
> +	int nid = MAX_NUMNODES;
> +	struct memory_failure_stats *mf_stats = NULL;
> +
> +	nid = pfn_to_nid(pfn);
> +	if (unlikely(nid < 0 || nid >= MAX_NUMNODES)) {
> +		WARN_ONCE(1, "Memory failure: pfn=%#lx, invalid nid=%d", pfn, nid);
> +		return;
> +	}
> +
...
> +	default:
> +		WARN_ONCE(1, "Memory failure: mf_result=%d is not properly handled", result);
> +		break;
> +	}

We already define pr_fmt, the "Memory failure:" prefix should be dropped.


  parent reply	other threads:[~2023-02-02  6:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20  3:46 [PATCH v2 0/3] Introduce per NUMA node memory error statistics Jiaqi Yan
2023-01-20  3:46 ` [PATCH v2 1/3] mm: memory-failure: Add memory failure stats to sysfs Jiaqi Yan
2023-01-23  2:42   ` HORIGUCHI NAOYA(堀口 直也)
2023-02-02  6:54   ` Kefeng Wang
2023-02-04 23:21     ` Jiaqi Yan
2023-01-20  3:46 ` [PATCH v2 2/3] mm: memory-failure: Bump memory failure stats to pglist_data Jiaqi Yan
2023-01-23  2:42   ` HORIGUCHI NAOYA(堀口 直也)
2023-02-02  6:56   ` Kefeng Wang [this message]
2023-02-04 23:17     ` Jiaqi Yan
2023-01-20  3:46 ` [PATCH v2 3/3] mm: memory-failure: Document memory failure stats Jiaqi Yan
2023-01-23  2: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=ad4de896-bec4-e2c3-922d-ca5500d3a78d@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=duenwen@google.com \
    --cc=jiaqiyan@google.com \
    --cc=linux-mm@kvack.org \
    --cc=naoya.horiguchi@nec.com \
    --cc=rientjes@google.com \
    --cc=shy828301@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