Re: [RFC][PATCH 2/3] alloc-order watermarks

From: Nick Piggin
Date: Sun Sep 05 2004 - 00:53:48 EST


Nick Piggin wrote:
2/3


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



Move the watermark checking code into a single function. Extend it to account
for the order of the allocation and the number of free pages that could satisfy
such a request.

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


---

linux-2.6-npiggin/include/linux/mmzone.h | 2 +
linux-2.6-npiggin/mm/page_alloc.c | 57 ++++++++++++++++++++-----------
2 files changed, 40 insertions(+), 19 deletions(-)

diff -puN mm/page_alloc.c~vm-alloc-order-watermarks mm/page_alloc.c
--- linux-2.6/mm/page_alloc.c~vm-alloc-order-watermarks 2004-09-05 14:55:46.000000000 +1000
+++ linux-2.6-npiggin/mm/page_alloc.c 2004-09-05 15:10:07.000000000 +1000
@@ -676,6 +676,36 @@ buffered_rmqueue(struct zone *zone, int }
/*
+ * Return the number of pages available for order 'order' allocations.
+ */

Sorry, stale comment. It actually returns 1 if free pages are above the
watermark, 0 otherwise.

+int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
+ int alloc_type, int can_try_harder, int gfp_high)
-
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/