Skip to contentSkip to conversation

vmscan: respect higher order in zone_reclaim()

PATCH In review Johannes Weiner 2 participants 3 messages Feb 17, 2009 – Feb 18, 2009

Subsystems (3)
lore
Share & tools
lore

Johannes Weiner

author maintainer
#0 lore raw

PATCH 1/1 vmscan: respect higher order in zone_reclaim()

zone_reclaim() already tries to free the requested 2^order pages but doesn't pass the order information into the inner reclaim code.

This prevents lumpy reclaim from happening on higher orders although the caller explicitely asked for that.

Fix it up by initializing the order field of the scan control according to the request.

---
 mm/vmscan.c |    1 +
 1 file changed, 1 insertion(+)
mm/vmscan.c +1 -0
@@ -2297,6 +2297,7 @@ static int __zone_reclaim(struct zone *z
 					SWAP_CLUSTER_MAX),
 		.gfp_mask = gfp_mask,
 		.swappiness = vm_swappiness,
+		.order = order,
 		.isolate_pages = isolate_pages_global,
 	};
 	unsigned long slab_reclaimable;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Johannes Weiner

zone_reclaim() already tries to free the requested 2^order pages but doesn't pass the order information into the inner reclaim code.

This prevents lumpy reclaim from happening on higher orders although the caller explicitely asked for that.

Fix it up by initializing the order field of the scan control according to the request.

I'm fine with the patch but the changelog could have been better. Optionally take this changelog but either way.

Optional alternative changelog
==============================

During page allocation, there are two stages of direct reclaim that are applied to each zone in the preferred list. The first stage using zone_reclaim() reclaims unmapped file backed pages and slab pages if over defined limits as these are cheaper to reclaim. The caller specifies the order of the target allocation but the scan control is not being correctly initialised.

The impact is that the correct number of pages are being reclaimed but that lumpy reclaim is not being applied. This increases the chances of a full direct reclaim via try_to_free_pages() is required.

This patch initialises the order field of the scan control as requested by the caller.

Quoted 17 lines
---
 mm/vmscan.c |    1 +
 1 file changed, 1 insertion(+)
mm/vmscan.c +1 -0
@@ -2297,6 +2297,7 @@ static int __zone_reclaim(struct zone *z
 					SWAP_CLUSTER_MAX),
 		.gfp_mask = gfp_mask,
 		.swappiness = vm_swappiness,
+		.order = order,
 		.isolate_pages = isolate_pages_global,
 	};
 	unsigned long slab_reclaimable;
Signature · 9 lines
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
author maintainer
#2 lore raw
Quoted 25 lines · Mel Gorman
Quoted 9 lines · Johannes Weiner

zone_reclaim() already tries to free the requested 2^order pages but doesn't pass the order information into the inner reclaim code.

This prevents lumpy reclaim from happening on higher orders although the caller explicitely asked for that.

Fix it up by initializing the order field of the scan control according to the request.

I'm fine with the patch but the changelog could have been better. Optionally take this changelog but either way.

Optional alternative changelog
==============================

During page allocation, there are two stages of direct reclaim that are applied to each zone in the preferred list. The first stage using zone_reclaim() reclaims unmapped file backed pages and slab pages if over defined limits as these are cheaper to reclaim. The caller specifies the order of the target allocation but the scan control is not being correctly initialised.

Quoted 6 lines

The impact is that the correct number of pages are being reclaimed but that lumpy reclaim is not being applied. This increases the chances of a full direct reclaim via try_to_free_pages() is required.

This patch initialises the order field of the scan control as requested by the caller.

Agreed, this is better. Thank you, Mel.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>