mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Previously, nothing prevented the page that was returned by pmap_extract()
from being reclaimed before it was wired. Use pmap_extract_and_hold() instead of pmap_extract() and retain the hold on the page until it has been wired.
This commit is contained in:
parent
ce887d5191
commit
5b5908005a
1 changed files with 3 additions and 4 deletions
|
|
@ -99,7 +99,6 @@ socow_setup(struct mbuf *m0, struct uio *uio)
|
|||
{
|
||||
struct sf_buf *sf;
|
||||
vm_page_t pp;
|
||||
vm_paddr_t pa;
|
||||
struct iovec *iov;
|
||||
struct vmspace *vmspace;
|
||||
struct vm_map *map;
|
||||
|
|
@ -120,12 +119,11 @@ socow_setup(struct mbuf *m0, struct uio *uio)
|
|||
/*
|
||||
* verify page is mapped & not already wired for i/o
|
||||
*/
|
||||
pa=pmap_extract(map->pmap, uva);
|
||||
if(!pa) {
|
||||
pp = pmap_extract_and_hold(map->pmap, uva, VM_PROT_READ);
|
||||
if (pp == NULL) {
|
||||
socow_stats.fail_not_mapped++;
|
||||
return(0);
|
||||
}
|
||||
pp = PHYS_TO_VM_PAGE(pa);
|
||||
|
||||
/*
|
||||
* set up COW
|
||||
|
|
@ -137,6 +135,7 @@ socow_setup(struct mbuf *m0, struct uio *uio)
|
|||
* wire the page for I/O
|
||||
*/
|
||||
vm_page_wire(pp);
|
||||
vm_page_unhold(pp);
|
||||
vm_page_unlock_queues();
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue