From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail202.messagelabs.com (mail202.messagelabs.com [216.82.254.227]) by kanga.kvack.org (Postfix) with SMTP id 739906B0088 for ; Sun, 12 Sep 2010 11:55:02 -0400 (EDT) Message-Id: <20100912155204.774257544@intel.com> Date: Sun, 12 Sep 2010 23:49:59 +0800 From: Wu Fengguang Subject: [PATCH 14/17] vmscan: add scan_control.priority References: <20100912154945.758129106@intel.com> Content-Disposition: inline; filename=mm-sc-priority.patch Sender: owner-linux-mm@kvack.org To: linux-mm Cc: LKML , Wu Fengguang , Andrew Morton , Theodore Ts'o , Dave Chinner , Jan Kara , Peter Zijlstra , Mel Gorman , Rik van Riel , KOSAKI Motohiro , Chris Mason , Christoph Hellwig , Li Shaohua List-ID: It seems most vmscan functions need the priority parameter. It will simplify code to put it into scan_control. It will be referenced in the next patch. This patch could convert the many exising functnions, but let's keep it simple at first. Signed-off-by: Wu Fengguang --- mm/vmscan.c | 4 ++++ 1 file changed, 4 insertions(+) --- linux-next.orig/mm/vmscan.c 2010-09-10 13:13:41.000000000 +0800 +++ linux-next/mm/vmscan.c 2010-09-10 13:17:01.000000000 +0800 @@ -78,6 +78,8 @@ struct scan_control { int order; + int priority; + /* * Intend to reclaim enough continuous memory rather than reclaim * enough amount of memory. i.e, mode for high order allocation. @@ -1875,6 +1877,7 @@ static unsigned long do_try_to_free_page for (priority = DEF_PRIORITY; priority >= 0; priority--) { sc->nr_scanned = 0; + sc->priority = priority; if (!priority) disable_swap_token(); all_unreclaimable = shrink_zones(priority, zonelist, sc); @@ -2127,6 +2130,7 @@ loop_again: disable_swap_token(); all_zones_ok = 1; + sc.priority = priority; /* * Scan in the highmem->dma direction for the highest -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org