]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm: soft-offline: fix num_poisoned_pages counting on concurrent events
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Tue, 5 May 2015 23:23:46 +0000 (16:23 -0700)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 23 May 2015 19:52:07 +0000 (15:52 -0400)
commit881241e8e37b2590ec8bcdce9dc554541010bb6a
treea915ee3e666b6fcfbde67dfb25c558e32d7b816a
parent4e258a15e1037e05492a11cde68cb4ece0a21248
mm: soft-offline: fix num_poisoned_pages counting on concurrent events

[ Upstream commit 602498f9aa43d4951eece3fd6ad95a6d0a78d537 ]

If multiple soft offline events hit one free page/hugepage concurrently,
soft_offline_page() can handle the free page/hugepage multiple times,
which makes num_poisoned_pages counter increased more than once.  This
patch fixes this wrong counting by checking TestSetPageHWPoison for normal
papes and by checking the return value of dequeue_hwpoisoned_huge_page()
for hugepages.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Dean Nelson <dnelson@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: <stable@vger.kernel.org> [3.14+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
mm/memory-failure.c