mm/sparse.c: don't manually decrement num_poisoned_pages

Use the function written to do it instead.

Link: http://lkml.kernel.org/r/20190827053656.32191-2-alastair@au1.ibm.com
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Wei Yang <richardw.yang@linux.intel.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Alastair D'Silva 2019-09-23 15:36:30 -07:00 committed by Linus Torvalds
parent c1cbc3eebf
commit 9f82883c6d
1 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,8 @@
#include <linux/export.h> #include <linux/export.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/swap.h>
#include <linux/swapops.h>
#include "internal.h" #include "internal.h"
#include <asm/dma.h> #include <asm/dma.h>
@ -908,7 +910,7 @@ static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages)
for (i = 0; i < nr_pages; i++) { for (i = 0; i < nr_pages; i++) {
if (PageHWPoison(&memmap[i])) { if (PageHWPoison(&memmap[i])) {
atomic_long_sub(1, &num_poisoned_pages); num_poisoned_pages_dec();
ClearPageHWPoison(&memmap[i]); ClearPageHWPoison(&memmap[i]);
} }
} }