Re: Re: [PATCH v2 5/5] mm/memory-failure.c: simplify num_poisoned_pages_inc/dec

From: zhenwei pi
Date: Wed May 11 2022 - 04:22:28 EST




On 5/11/22 16:20, HORIGUCHI NAOYA(堀口 直也) wrote:
On Mon, May 09, 2022 at 06:56:41PM +0800, zhenwei pi wrote:
Originally, do num_poisoned_pages_inc() in memory failure routine,
use num_poisoned_pages_dec() to rollback the number if filtered/
cancelled.

Suggested by Naoya, do num_poisoned_pages_inc() only in
action_result(), this make this clear and simple.

Signed-off-by: zhenwei pi <pizhenwei@xxxxxxxxxxxxx>

I found that action_result(MF_MSG_UNKNOWN) in try_memory_failure_hugetlb()
does not follow the rule, so that could break the counter.
I don't think this is the issue in your patch, so I'm fine with this patch.

I'll submit a fix later for this, which will add hugetlb_set_page_hwpoison()
in the path. That will have a bit non-trivial change because we need do
this in hugeltb_lock.

Anyway, thank you for this work.

Acked-by: Naoya Horiguchi <naoya.horiguchi@xxxxxxx>

A million thanks to you!

--
zhenwei pi