From c8b7a853ccfce0ec07852774cc231c6872e51852 Mon Sep 17 00:00:00 2001 From: NAKAMURA Gou Date: Wed, 29 May 2013 19:04:20 +0900 Subject: [PATCH] changed the number of pages to allocate struct malloc_header is necessary at both ends of the new free space. however, only one malloc_header is included in the req_pages. --- kernel/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/mem.c b/kernel/mem.c index c5e0bde4..9d0c374c 100644 --- a/kernel/mem.c +++ b/kernel/mem.c @@ -316,7 +316,7 @@ void *kmalloc(int size, enum ihk_mc_ap_flag flag) while (1) { if (h == &v->free_list) { - req_page = ((u + 1) * sizeof(*h) + PAGE_SIZE - 1) + req_page = ((u + 2) * sizeof(*h) + PAGE_SIZE - 1) >> PAGE_SHIFT; h = allocate_pages(req_page, flag);