]> git.baikalelectronics.ru Git - kernel.git/commit
mm/memory-failure.c: simplify num_poisoned_pages_dec
authorzhenwei pi <pizhenwei@bytedance.com>
Fri, 13 May 2022 03:23:09 +0000 (20:23 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 13 May 2022 14:20:19 +0000 (07:20 -0700)
commitb2bee2b2fc0556058e65961b7a2efd4a5722e5a0
treef5d419b3dca78499e45c2cfa19a6f24c6cef89dc
parenta6d1d1123072cb4692b6c9d1c0f5f4eb6606fefa
mm/memory-failure.c: simplify num_poisoned_pages_dec

Don't decrease the number of poisoned pages in page_alloc.c, let the
memory-failure.c do inc/dec poisoned pages only.

Also simplify unpoison_memory(), only decrease the number of
poisoned pages when:
 - TestClearPageHWPoison() succeed
 - put_page_back_buddy succeed

After decreasing, print necessary log.

Finally, remove clear_page_hwpoison() and unpoison_taken_off_page().

Link: https://lkml.kernel.org/r/20220509105641.491313-3-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
mm/page_alloc.c