aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2018-11-29 16:31:01 +0000
committerMark Johnston <markj@FreeBSD.org>2018-11-29 16:31:01 +0000
commite31fc3ab13c592634e29139be48c40251c99b62d (patch)
tree68f679d919e756884fac6a2f29016308a438e0db
parent26ebe6565de4851c4cbded755258d82ed0939841 (diff)
downloadsrc-e31fc3ab13c592634e29139be48c40251c99b62d.tar.gz
src-e31fc3ab13c592634e29139be48c40251c99b62d.zip
Update the free page count when blacklisting pages.
Otherwise the free page count will not accurately reflect the physical page allocator's state. On 11 this can trigger panics in vm_page_alloc() since the allocator state and free page count are updated atomically and we expect them to stay in sync. On 12 the bug would manifest as threads looping in vm_page_alloc(). PR: 231296 Reported by: mav, wollman, Rainer Duffner, Josh Gitlin Reviewed by: alc, kib, mav MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18374
Notes
Notes: svn path=/head/; revision=341247
-rw-r--r--sys/vm/vm_page.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 10b6f7b4a916..f5115a578c71 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -355,7 +355,8 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose)
vm_domain_free_lock(vmd);
ret = vm_phys_unfree_page(m);
vm_domain_free_unlock(vmd);
- if (ret) {
+ if (ret != 0) {
+ vm_domain_freecnt_inc(vmd, -1);
TAILQ_INSERT_TAIL(&blacklist_head, m, listq);
if (verbose)
printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa);