diff options
author | alc <alc@FreeBSD.org> | 2004-10-18 08:11:59 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-10-18 08:11:59 +0000 |
commit | a1afafd0dade7dcb1eccae4df8aa7bf1d00d74c9 (patch) | |
tree | fa03ddbd067afb4b5448c03d25b254505d37442b /sys/vm/vm_page.c | |
parent | 86a40eb88d4d1827302954e993083b04726e7b02 (diff) | |
download | FreeBSD-src-a1afafd0dade7dcb1eccae4df8aa7bf1d00d74c9.zip FreeBSD-src-a1afafd0dade7dcb1eccae4df8aa7bf1d00d74c9.tar.gz |
Correct two errors in PG_BUSY management by vm_page_cowfault(). Both
errors are in rarely executed paths.
1. Each time the retry_alloc path is taken, the PG_BUSY must be set again.
Otherwise vm_page_remove() panics.
2. There is no need to set PG_BUSY on the newly allocated page before
freeing it. The page already has PG_BUSY set by vm_page_alloc().
Setting it again could cause an assertion failure.
MFC after: 2 weeks
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r-- | sys/vm/vm_page.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 561a5d8..d555309 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1656,9 +1656,9 @@ vm_page_cowfault(vm_page_t m) object = m->object; pindex = m->pindex; - vm_page_busy(m); retry_alloc: + vm_page_busy(m); vm_page_remove(m); mnew = vm_page_alloc(object, pindex, VM_ALLOC_NORMAL); if (mnew == NULL) { @@ -1677,7 +1677,6 @@ vm_page_cowfault(vm_page_t m) * waiting to allocate a page. If so, put things back * the way they were */ - vm_page_busy(mnew); vm_page_free(mnew); vm_page_insert(m, object, pindex); } else { /* clear COW & copy page */ |