search_free_space: remove POSTK_DEBUG_ARCH_DEP_27 side
search_free_space changed since this was implemented and the code is no longer compatible Looking at it again, the function is not used anywhere other than syscall.c and the second function does not seem to fix anything specific so this just removes the untested side. Change-Id: If28d35ec4da083a40dc6936fcb21f05fb64e378a Fujitsu: POSTK_DEBUG_ARCH_DEP_27
This commit is contained in:
committed by
Dominique Martinet
parent
a5c3e48843
commit
0994c3300e
42
kernel/mem.c
42
kernel/mem.c
@ -2298,48 +2298,6 @@ void ___kmalloc_print_free_list(struct list_head *list)
|
||||
kprintf_unlock(irqflags);
|
||||
}
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_27
|
||||
int search_free_space(struct thread *thread, size_t len, intptr_t hint,
|
||||
int pgshift, intptr_t *addrp)
|
||||
{
|
||||
struct vm_regions *region = &thread->vm->region;
|
||||
intptr_t addr;
|
||||
int error;
|
||||
struct vm_range *range;
|
||||
size_t pgsize = (size_t)1 << pgshift;
|
||||
|
||||
dkprintf("search_free_space(%lx,%lx,%d,%p)\n", len, hint, pgshift, addrp);
|
||||
|
||||
addr = hint;
|
||||
for (;;) {
|
||||
addr = (addr + pgsize - 1) & ~(pgsize - 1);
|
||||
if ((region->user_end <= addr)
|
||||
|| ((region->user_end - len) < addr)) {
|
||||
ekprintf("search_free_space(%lx,%lx,%p):"
|
||||
"no space. %lx %lx\n",
|
||||
len, hint, addrp, addr,
|
||||
region->user_end);
|
||||
error = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
range = lookup_process_memory_range(thread->vm, addr, addr+len);
|
||||
if (range == NULL) {
|
||||
break;
|
||||
}
|
||||
addr = range->end;
|
||||
}
|
||||
|
||||
error = 0;
|
||||
*addrp = addr;
|
||||
|
||||
out:
|
||||
dkprintf("search_free_space(%lx,%lx,%d,%p): %d %lx\n",
|
||||
len, hint, pgshift, addrp, error, addr);
|
||||
return error;
|
||||
}
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_27 */
|
||||
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_52 /* supports NUMA for memory area determination */
|
||||
#ifdef IHK_RBTREE_ALLOCATOR
|
||||
int is_mckernel_memory(unsigned long phys)
|
||||
|
||||
@ -59,9 +59,6 @@
|
||||
#include <rusage_private.h>
|
||||
#include <ihk/monitor.h>
|
||||
#include <profile.h>
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_27
|
||||
#include <memory.h>
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_27 */
|
||||
|
||||
/* Headers taken from kitten LWK */
|
||||
#include <lwk/stddef.h>
|
||||
@ -1288,8 +1285,6 @@ int do_munmap(void *addr, size_t len)
|
||||
return error;
|
||||
}
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_27
|
||||
#else
|
||||
static int search_free_space(size_t len, int pgshift, intptr_t *addrp)
|
||||
{
|
||||
struct thread *thread = cpu_local_var(current);
|
||||
@ -1330,7 +1325,6 @@ out:
|
||||
__FUNCTION__, len, pgshift, addr);
|
||||
return error;
|
||||
}
|
||||
#endif
|
||||
|
||||
intptr_t
|
||||
do_mmap(const intptr_t addr0, const size_t len0, const int prot,
|
||||
@ -1423,12 +1417,7 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot,
|
||||
}
|
||||
else {
|
||||
/* Obtain mapping address */
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_27
|
||||
error = search_free_space(cpu_local_var(current), len,
|
||||
region->map_end, PAGE_SHIFT + p2align, &addr);
|
||||
#else
|
||||
error = search_free_space(len, PAGE_SHIFT + p2align, &addr);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_27 */
|
||||
if (error) {
|
||||
ekprintf("do_mmap:search_free_space(%lx,%lx,%d) failed. %d\n",
|
||||
len, region->map_end, p2align, error);
|
||||
@ -4983,12 +4972,7 @@ SYSCALL_DECLARE(shmat)
|
||||
}
|
||||
}
|
||||
else {
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_27
|
||||
error = search_free_space(cpu_local_var(current), len,
|
||||
region->map_end, obj->pgshift, &addr);
|
||||
#else
|
||||
error = search_free_space(len, obj->pgshift, &addr);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_27 */
|
||||
if (error) {
|
||||
ihk_mc_spinlock_unlock_noirq(&vm->memory_range_lock);
|
||||
shmobj_list_unlock();
|
||||
@ -7822,14 +7806,8 @@ SYSCALL_DECLARE(mremap)
|
||||
goto out;
|
||||
}
|
||||
need_relocate = 1;
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_27
|
||||
error = search_free_space(cpu_local_var(current), newsize,
|
||||
vm->region.map_end,
|
||||
range->pgshift, (intptr_t *)&newstart);
|
||||
#else
|
||||
error = search_free_space(newsize, range->pgshift,
|
||||
(intptr_t *)&newstart);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_27 */
|
||||
if (error) {
|
||||
ekprintf("sys_mremap(%#lx,%#lx,%#lx,%#x,%#lx):"
|
||||
"search failed. %d\n",
|
||||
|
||||
@ -46,11 +46,6 @@ int setlong_user(long *dst, long data);
|
||||
int setint_user(int *dst, int data);
|
||||
int write_process_vm(struct process_vm *vm, void *udst, const void *ksrc, size_t siz);
|
||||
int patch_process_vm(struct process_vm *vm, void *udst, const void *ksrc, size_t siz);
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_27
|
||||
struct thread;
|
||||
int search_free_space(struct thread *thread, size_t len, intptr_t hint,
|
||||
int pgshift, intptr_t *addrp);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_27 */
|
||||
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_52 /* supports NUMA for memory area determination */
|
||||
int is_mckernel_memory(unsigned long phys);
|
||||
|
||||
Reference in New Issue
Block a user