diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2015-12-06 10:42:44 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2015-12-06 10:42:44 +0000 |
commit | 5c558316fc3913afe9415c06b52283c8538e8bfc (patch) | |
tree | b34b135b7fb00dea69e9c892d7dd0db8ad4b5c85 /sys/uvm/uvm_pmemrange.c | |
parent | 63810796c59676ed5c06d6010fd24192072de21a (diff) |
Since the page zeroing thread runs without the kernel lock,
it relies upon the fpageq lock for data consistency and
sleep/wakeup interlocking.
Therefore, code which modifies page zeroing thread data
or performs a wakeup of the thread must also hold the
fpageq lock.
Fix an instance where this was not the case.
ok kettenis@
diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c
Diffstat (limited to 'sys/uvm/uvm_pmemrange.c')
-rw-r--r-- | sys/uvm/uvm_pmemrange.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c index f4a86c9936d..001e249bad2 100644 --- a/sys/uvm/uvm_pmemrange.c +++ b/sys/uvm/uvm_pmemrange.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pmemrange.c,v 1.48 2015/08/21 16:04:35 visa Exp $ */ +/* $OpenBSD: uvm_pmemrange.c,v 1.49 2015/12/06 10:42:43 blambert Exp $ */ /* * Copyright (c) 2009, 2010 Ariane van der Steldt <ariane@stack.nl> @@ -1036,9 +1036,11 @@ out: atomic_clearbits_int(&found->pg_flags, PG_PMAPMASK); if (found->pg_flags & PG_ZERO) { + uvm_lock_fpageq(); uvmexp.zeropages--; if (uvmexp.zeropages < UVM_PAGEZERO_TARGET) wakeup(&uvmexp.zeropages); + uvm_unlock_fpageq(); } if (flags & UVM_PLA_ZERO) { if (found->pg_flags & PG_ZERO) |