vm: Add missing WITNESS warnings for M_WAITOK allocation
vm_map_clip_{end,start} and lookup_clip_start allocate memory M_WAITOK for !system_map vm_maps. Add WITNESS warning annotation for !system_map callers who may be holding non-sleepable locks. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D25283
This commit is contained in:
parent
ac2adfb86d
commit
8a64110e43
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362784
@ -2379,6 +2379,11 @@ vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start)
|
|||||||
{
|
{
|
||||||
vm_map_entry_t new_entry;
|
vm_map_entry_t new_entry;
|
||||||
|
|
||||||
|
if (!map->system_map)
|
||||||
|
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
|
||||||
|
"%s: map %p entry %p start 0x%jx", __func__, map, entry,
|
||||||
|
(uintmax_t)start);
|
||||||
|
|
||||||
if (start <= entry->start)
|
if (start <= entry->start)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -2409,6 +2414,11 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t start,
|
|||||||
{
|
{
|
||||||
vm_map_entry_t entry;
|
vm_map_entry_t entry;
|
||||||
|
|
||||||
|
if (!map->system_map)
|
||||||
|
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
|
||||||
|
"%s: map %p start 0x%jx prev %p", __func__, map,
|
||||||
|
(uintmax_t)start, prev_entry);
|
||||||
|
|
||||||
if (vm_map_lookup_entry(map, start, prev_entry)) {
|
if (vm_map_lookup_entry(map, start, prev_entry)) {
|
||||||
entry = *prev_entry;
|
entry = *prev_entry;
|
||||||
vm_map_clip_start(map, entry, start);
|
vm_map_clip_start(map, entry, start);
|
||||||
@ -2430,6 +2440,11 @@ vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end)
|
|||||||
{
|
{
|
||||||
vm_map_entry_t new_entry;
|
vm_map_entry_t new_entry;
|
||||||
|
|
||||||
|
if (!map->system_map)
|
||||||
|
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
|
||||||
|
"%s: map %p entry %p end 0x%jx", __func__, map, entry,
|
||||||
|
(uintmax_t)end);
|
||||||
|
|
||||||
if (end >= entry->end)
|
if (end >= entry->end)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -3725,6 +3740,7 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end)
|
|||||||
vm_map_entry_t entry, next_entry;
|
vm_map_entry_t entry, next_entry;
|
||||||
|
|
||||||
VM_MAP_ASSERT_LOCKED(map);
|
VM_MAP_ASSERT_LOCKED(map);
|
||||||
|
|
||||||
if (start == end)
|
if (start == end)
|
||||||
return (KERN_SUCCESS);
|
return (KERN_SUCCESS);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user