Skip to content

Commit 183f637

Browse files
Mel Gormantorvalds
authored andcommitted
mm: ignore mempolicies when using ALLOC_NO_WATERMARK
The reserve is proportionally distributed over all !highmem zones in the system. So we need to allow an emergency allocation access to all zones. In order to do that we need to break out of any mempolicy boundaries we might have. In my opinion that does not break mempolicies as those are user oriented and not system oriented. That is, system allocations are not guaranteed to be within mempolicy boundaries. For instance IRQs do not even have a mempolicy. So breaking out of mempolicy boundaries for 'rare' emergency allocations, which are always system allocations (as opposed to user) is ok. Signed-off-by: Peter Zijlstra <[email protected]> Signed-off-by: Mel Gorman <[email protected]> Cc: David Miller <[email protected]> Cc: Neil Brown <[email protected]> Cc: Mike Christie <[email protected]> Cc: Eric B Munson <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent cfd19c5 commit 183f637

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mm/page_alloc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,6 +2378,13 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
23782378

23792379
/* Allocate without watermarks if the context allows */
23802380
if (alloc_flags & ALLOC_NO_WATERMARKS) {
2381+
/*
2382+
* Ignore mempolicies if ALLOC_NO_WATERMARKS on the grounds
2383+
* the allocation is high priority and these type of
2384+
* allocations are system rather than user orientated
2385+
*/
2386+
zonelist = node_zonelist(numa_node_id(), gfp_mask);
2387+
23812388
page = __alloc_pages_high_priority(gfp_mask, order,
23822389
zonelist, high_zoneidx, nodemask,
23832390
preferred_zone, migratetype);

0 commit comments

Comments
 (0)