Touch all the pages wired by sysctl_wire_old_buffer() to avoid PTE
modified bit emulation traps on Alpha while holding locks in the sysctl handler. A better solution would be to pass a hint to the Alpha pmap code to tell mark these pages as modified when they as they are being wired, but that appears to be more difficult to implement. Suggested by: jhb MFC after: 3 days
This commit is contained in:
parent
4730881b84
commit
9f8a407ccb
@ -1118,7 +1118,8 @@ int
|
||||
sysctl_wire_old_buffer(struct sysctl_req *req, size_t len)
|
||||
{
|
||||
int ret;
|
||||
size_t wiredlen;
|
||||
size_t i, wiredlen;
|
||||
char *cp, dummy;
|
||||
|
||||
wiredlen = (len > 0 && len < req->oldlen) ? len : req->oldlen;
|
||||
ret = 0;
|
||||
@ -1131,6 +1132,16 @@ sysctl_wire_old_buffer(struct sysctl_req *req, size_t len)
|
||||
return (ret);
|
||||
wiredlen = 0;
|
||||
}
|
||||
/*
|
||||
* Touch all the wired pages to avoid PTE modified
|
||||
* bit emulation traps on Alpha while holding locks
|
||||
* in the sysctl handler.
|
||||
*/
|
||||
for (i = (wiredlen + PAGE_SIZE - 1) / PAGE_SIZE,
|
||||
cp = req->oldptr; i > 0; i--, cp += PAGE_SIZE) {
|
||||
copyin(cp, &dummy, 1);
|
||||
copyout(&dummy, cp, 1);
|
||||
}
|
||||
}
|
||||
req->lock = REQ_WIRED;
|
||||
req->validlen = wiredlen;
|
||||
|
Loading…
Reference in New Issue
Block a user