mm/memory-failure.c: simplify num_poisoned_pages_inc/dec
authorzhenwei pi <pizhenwei@bytedance.com>
Fri, 13 May 2022 03:23:10 +0000 (20:23 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 13 May 2022 14:20:19 +0000 (07:20 -0700)
commite240ac52f7da5986f9dcbe29d423b7b2f141b41b
tree29eaf4f711fccf9a14ae3db3fd90ae1f733eca45
parentf0696cb4068a0d79cf9795ad34560d2f6200d42c
mm/memory-failure.c: simplify num_poisoned_pages_inc/dec

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.

Link: https://lkml.kernel.org/r/20220509105641.491313-6-pizhenwei@bytedance.com
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c