mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
o Synchronize updates to struct vm_page::cow with the page queues lock.
This commit is contained in:
parent
e2c4e1b55f
commit
8a59b15cd4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102835
@ -96,7 +96,9 @@ socow_iodone(void *addr, void *args)
|
||||
pp = PHYS_TO_VM_PAGE(paddr);
|
||||
s = splvm();
|
||||
/* remove COW mapping */
|
||||
vm_page_lock_queues();
|
||||
vm_page_cowclear(pp);
|
||||
vm_page_unlock_queues();
|
||||
vm_object_deallocate(pp->object);
|
||||
splx(s);
|
||||
/* note that sf_buf_free() unwires the page for us*/
|
||||
@ -141,12 +143,12 @@ socow_setup(struct mbuf *m0, struct uio *uio)
|
||||
/*
|
||||
* set up COW
|
||||
*/
|
||||
vm_page_lock_queues();
|
||||
vm_page_cowsetup(pp);
|
||||
|
||||
/*
|
||||
* wire the page for I/O
|
||||
*/
|
||||
vm_page_lock_queues();
|
||||
vm_page_wire(pp);
|
||||
vm_page_unlock_queues();
|
||||
|
||||
|
@ -1812,10 +1812,9 @@ void
|
||||
vm_page_cowclear(vm_page_t m)
|
||||
{
|
||||
|
||||
/* XXX KDM find out if giant is required here. */
|
||||
GIANT_REQUIRED;
|
||||
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
|
||||
if (m->cow) {
|
||||
atomic_subtract_int(&m->cow, 1);
|
||||
m->cow--;
|
||||
/*
|
||||
* let vm_fault add back write permission lazily
|
||||
*/
|
||||
@ -1828,9 +1827,9 @@ vm_page_cowclear(vm_page_t m)
|
||||
void
|
||||
vm_page_cowsetup(vm_page_t m)
|
||||
{
|
||||
/* XXX KDM find out if giant is required here */
|
||||
GIANT_REQUIRED;
|
||||
atomic_add_int(&m->cow, 1);
|
||||
|
||||
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
|
||||
m->cow++;
|
||||
vm_page_protect(m, VM_PROT_READ);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user