o Remove GIANT_REQUIRED from vm_map_madvise(). Instead, acquire and
release Giant around vm_map_madvise()'s call to pmap_object_init_pt(). o Replace GIANT_REQUIRED in vm_object_madvise() with the acquisition and release of Giant. o Remove the acquisition and release of Giant from madvise().
This commit is contained in:
parent
98c00afd22
commit
9739bce402
@ -1268,8 +1268,6 @@ vm_map_madvise(
|
||||
vm_map_entry_t current, entry;
|
||||
int modify_map = 0;
|
||||
|
||||
GIANT_REQUIRED;
|
||||
|
||||
/*
|
||||
* Some madvise calls directly modify the vm_map_entry, in which case
|
||||
* we need to use an exclusive lock on the map and we need to perform
|
||||
@ -1390,6 +1388,7 @@ vm_map_madvise(
|
||||
vm_object_madvise(current->object.vm_object,
|
||||
pindex, count, behav);
|
||||
if (behav == MADV_WILLNEED) {
|
||||
mtx_lock(&Giant);
|
||||
pmap_object_init_pt(
|
||||
map->pmap,
|
||||
useStart,
|
||||
@ -1398,6 +1397,7 @@ vm_map_madvise(
|
||||
(count << PAGE_SHIFT),
|
||||
MAP_PREFAULT_MADVISE
|
||||
);
|
||||
mtx_unlock(&Giant);
|
||||
}
|
||||
}
|
||||
vm_map_unlock_read(map);
|
||||
|
@ -743,7 +743,6 @@ madvise(td, uap)
|
||||
struct madvise_args *uap;
|
||||
{
|
||||
vm_offset_t start, end;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* Check for illegal behavior
|
||||
@ -771,10 +770,10 @@ madvise(td, uap)
|
||||
start = trunc_page((vm_offset_t) uap->addr);
|
||||
end = round_page((vm_offset_t) uap->addr + uap->len);
|
||||
|
||||
mtx_lock(&Giant);
|
||||
ret = vm_map_madvise(&td->td_proc->p_vmspace->vm_map, start, end, uap->behav);
|
||||
mtx_unlock(&Giant);
|
||||
return (ret ? EINVAL : 0);
|
||||
if (vm_map_madvise(&td->td_proc->p_vmspace->vm_map, start, end,
|
||||
uap->behav))
|
||||
return (EINVAL);
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifndef _SYS_SYSPROTO_H_
|
||||
|
@ -1002,10 +1002,11 @@ vm_object_madvise(vm_object_t object, vm_pindex_t pindex, int count, int advise)
|
||||
vm_object_t tobject;
|
||||
vm_page_t m;
|
||||
|
||||
GIANT_REQUIRED;
|
||||
if (object == NULL)
|
||||
return;
|
||||
|
||||
mtx_lock(&Giant);
|
||||
|
||||
end = pindex + count;
|
||||
|
||||
/*
|
||||
@ -1093,6 +1094,7 @@ vm_object_madvise(vm_object_t object, vm_pindex_t pindex, int count, int advise)
|
||||
swap_pager_freespace(tobject, tpindex, 1);
|
||||
}
|
||||
}
|
||||
mtx_unlock(&Giant);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user