Re: [RFC][PATCH 1/3] account free buddy areas

From: Nick Piggin
Date: Sun Sep 05 2004 - 01:14:56 EST


Nick Piggin wrote:
1/3


------------------------------------------------------------------------



Keep track of the number of free pages of each order in the buddy allocator.

Signed-off-by: Nick Piggin <nickpiggin@xxxxxxxxxxxx>


---

linux-2.6-npiggin/include/linux/mmzone.h | 1 +
linux-2.6-npiggin/mm/page_alloc.c | 22 ++++++++--------------
2 files changed, 9 insertions(+), 14 deletions(-)

diff -puN mm/page_alloc.c~vm-free-order-pages mm/page_alloc.c
--- linux-2.6/mm/page_alloc.c~vm-free-order-pages 2004-09-05 14:53:53.000000000 +1000
+++ linux-2.6-npiggin/mm/page_alloc.c 2004-09-05 14:53:53.000000000 +1000
@@ -216,6 +216,7 @@ static inline void __free_pages_bulk (st
page_idx &= mask;
}
list_add(&(base + page_idx)->lru, &area->free_list);
+ area->nr_free++;
}

Ahh, yes _that_ is why I got an offset in page_alloc.c

Obviously this function needs an area->nr_free-- in the loop somewhere around
list_del(&buddy1->lru);

I have actually tested the complete patchset with this addition, I just forgot
to update the patch.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/