High order memory allocations (was Re: Memory Problem in

Alex Bligh - linux-kernel (linux-kernel@alex.org.uk)
Sun, 02 Sep 2001 23:36:07 +0100


Next problem / idea:

memory_pressure sets the target for inactive_target (hence
free_target etc.)

However, if you do (say) and order 5 allocation, memory
pressure is only incremented by 1. This seems illogical,
especially given __alloc_pages does not loop via
try_again, on order>0 allocations (except
when freeshortage() is true) even if __GFP_WAIT
is set (I suspect because it just sits there for
ever). In practice, this means page_launder only
has one shot at freeing sufficient pages, and this
with a wrong inactive target. I propose something
like (whitespace broken - sorry):

--- mm/page_alloc.c.keep Sun Sep 2 23:32:56 2001
+++ mm/page_alloc.c Sun Sep 2 23:34:03 2001
@@ -141,8 +141,8 @@
* since it's nothing important, but we do want to make sure
* it never gets negative.
*/
- if (memory_pressure > NR_CPUS)
- memory_pressure--;
+ if (memory_pressure > (NR_CPUS << order))
+ memory_pressure-= 1<<order;
}

#define MARK_USED(index, order, area) \
@@ -288,7 +288,7 @@
/*
* Allocations put pressure on the VM subsystem.
*/
- memory_pressure++;
+ memory_pressure+= 1<<order;

/*
* (If anyone calls gfp from interrupts nonatomically then it

--
Alex Bligh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/