summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-04-22 20:39:53 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-04-22 20:39:53 +0200
commit4e8066a555118a5f71c9fa770dad81592b5fe2f4 (patch)
treedbcce02aecdafd5a1c991cedbff71dbbf683f4eb
parent07dc2f7b615f1b6af4acbbc034615856557ef7cd (diff)
Warn once when part of the kernel is lacking space
* ipc/ipc_entry.c (ipc_entry_get, ipc_entry_grow_table): Warn when returning KERN_NO_SPACE. * vm/vm_map.c (vm_map_find_entry, vm_map_enter, vm_map_copyout, vm_map_copyout_page_list): Warn when returning KERN_NO_SPACE.
-rw-r--r--ipc/ipc_entry.c5
-rw-r--r--vm/vm_map.c31
2 files changed, 28 insertions, 8 deletions
diff --git a/ipc/ipc_entry.c b/ipc/ipc_entry.c
index 9084411..631de42 100644
--- a/ipc/ipc_entry.c
+++ b/ipc/ipc_entry.c
@@ -155,8 +155,10 @@ ipc_entry_get(space, namep, entryp)
table = space->is_table;
first_free = table->ie_next;
- if (first_free == 0)
+ if (first_free == 0) {
+ printf_once("no more room for ipc_entry_get in space %p\n", space);
return KERN_NO_SPACE;
+ }
free_entry = &table[first_free];
table->ie_next = free_entry->ie_next;
@@ -577,6 +579,7 @@ ipc_entry_grow_table(space)
if (osize == size) {
is_write_unlock(space);
+ printf_once("no more room for ipc_entry_grow_table in space %p\n", space);
return KERN_NO_SPACE;
}
diff --git a/vm/vm_map.c b/vm/vm_map.c
index dc2388d..7ea0b95 100644
--- a/vm/vm_map.c
+++ b/vm/vm_map.c
@@ -534,13 +534,17 @@ kern_return_t vm_map_find_entry(map, address, size, mask, object, o_entry)
* wrap around the address.
*/
- if (((start + mask) & ~mask) < start)
+ if (((start + mask) & ~mask) < start) {
+ printf_once("no more room for vm_map_find_entry in %p\n", map);
return(KERN_NO_SPACE);
+ }
start = ((start + mask) & ~mask);
end = start + size;
- if ((end > map->max_offset) || (end < start))
+ if ((end > map->max_offset) || (end < start)) {
+ printf_once("no more room for vm_map_find_entry in %p\n", map);
return(KERN_NO_SPACE);
+ }
/*
* If there are no more entries, we must win.
@@ -763,8 +767,10 @@ kern_return_t vm_map_enter(
if (start < map->min_offset)
start = map->min_offset;
- if (start > map->max_offset)
+ if (start > map->max_offset) {
+ printf_once("no more room for vm_map_enter in %p\n", map);
RETURN(KERN_NO_SPACE);
+ }
/*
* Look for the first possible address;
@@ -797,8 +803,10 @@ kern_return_t vm_map_enter(
* wrap around the address.
*/
- if (((start + mask) & ~mask) < start)
+ if (((start + mask) & ~mask) < start) {
+ printf_once("no more room for vm_map_enter in %p\n", map);
RETURN(KERN_NO_SPACE);
+ }
start = ((start + mask) & ~mask);
end = start + size;
@@ -813,6 +821,7 @@ kern_return_t vm_map_enter(
}
}
+ printf_once("no more room for vm_map_enter in %p\n", map);
RETURN(KERN_NO_SPACE);
}
@@ -849,8 +858,10 @@ kern_return_t vm_map_enter(
* the mask requirement.
*/
- if ((start & mask) != 0)
+ if ((start & mask) != 0) {
+ printf_once("no more room for vm_map_enter in %p\n", map);
return(KERN_NO_SPACE);
+ }
vm_map_lock(map);
@@ -870,8 +881,10 @@ kern_return_t vm_map_enter(
* ... the starting address isn't allocated
*/
- if (vm_map_lookup_entry(map, start, &temp_entry))
+ if (vm_map_lookup_entry(map, start, &temp_entry)) {
+ printf_once("no more room for vm_map_enter in %p\n", map);
RETURN(KERN_NO_SPACE);
+ }
entry = temp_entry;
@@ -881,8 +894,10 @@ kern_return_t vm_map_enter(
*/
if ((entry->vme_next != vm_map_to_entry(map)) &&
- (entry->vme_next->vme_start < end))
+ (entry->vme_next->vme_start < end)) {
+ printf_once("no more room for vm_map_enter in %p\n", map);
RETURN(KERN_NO_SPACE);
+ }
}
/*
@@ -2486,6 +2501,7 @@ kern_return_t vm_map_copyout(dst_map, dst_addr, copy)
}
}
vm_map_unlock(dst_map);
+ printf_once("no more room for vm_map_copyout in %p\n", dst_map);
return(KERN_NO_SPACE);
}
@@ -2730,6 +2746,7 @@ StartAgain:
}
}
vm_map_unlock(dst_map);
+ printf_once("no more room for vm_map_copyout_page_list in %p\n", dst_map);
return(KERN_NO_SPACE);
}