diff options
author | Mike Kravetz <mike.kravetz@oracle.com> | 2022-04-15 05:13:52 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-04-16 00:49:55 +0300 |
commit | 5a317412ef884763fdf7aa17f9f3636959d11d8f (patch) | |
tree | 28d3f08cd0e8a61139d2cf79fc67d2bc6d22851f /mm/page_vma_mapped.c | |
parent | 31ca72fa7540bb654b55c56adaf99305847376e0 (diff) | |
download | linux-5a317412ef884763fdf7aa17f9f3636959d11d8f.tar.xz |
hugetlb: do not demote poisoned hugetlb pages
It is possible for poisoned hugetlb pages to reside on the free lists.
The huge page allocation routines which dequeue entries from the free
lists make a point of avoiding poisoned pages. There is no such check
and avoidance in the demote code path.
If a hugetlb page on the is on a free list, poison will only be set in
the head page rather then the page with the actual error. If such a
page is demoted, then the poison flag may follow the wrong page. A page
without error could have poison set, and a page with poison could not
have the flag set.
Check for poison before attempting to demote a hugetlb page. Also,
return -EBUSY to the caller if only poisoned pages are on the free list.
Link: https://lkml.kernel.org/r/20220307215707.50916-1-mike.kravetz@oracle.com
Fixes: 8531fc6f52f5 ("hugetlb: add hugetlb demote page support")
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_vma_mapped.c')
0 files changed, 0 insertions, 0 deletions