Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764358AbXHHQP4 (ORCPT ); Wed, 8 Aug 2007 12:15:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753091AbXHHQP2 (ORCPT ); Wed, 8 Aug 2007 12:15:28 -0400 Received: from gir.skynet.ie ([193.1.99.77]:53567 "EHLO gir.skynet.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763311AbXHHQP1 (ORCPT ); Wed, 8 Aug 2007 12:15:27 -0400 From: Mel Gorman To: Lee.Schermerhorn@hp.com, pj@sgi.com, ak@suse.de, kamezawa.hiroyu@jp.fujitsu.com, clameter@sgi.com Cc: Mel Gorman , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Message-Id: <20070808161524.32320.87008.sendpatchset@skynet.skynet.ie> In-Reply-To: <20070808161504.32320.79576.sendpatchset@skynet.skynet.ie> References: <20070808161504.32320.79576.sendpatchset@skynet.skynet.ie> Subject: [PATCH 1/3] Use zonelists instead of zones when direct reclaiming pages Date: Wed, 8 Aug 2007 17:15:24 +0100 (IST) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3183 Lines: 65 The allocator deals with zonelists which indicate the order in which zones should be targeted for an allocation. Similarly, direct reclaim of pages iterates over an array of zones. For consistency, this patch converts direct reclaim to use a zonelist. No functionality is changed by this patch. This simplifies zonelist iterators in the next patch. Signed-off-by: Mel Gorman --- include/linux/swap.h | 2 +- mm/page_alloc.c | 2 +- mm/vmscan.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.23-rc1-mm2-clean/include/linux/swap.h linux-2.6.23-rc1-mm2-005_freepages_zonelist/include/linux/swap.h --- linux-2.6.23-rc1-mm2-clean/include/linux/swap.h 2007-08-07 14:45:11.000000000 +0100 +++ linux-2.6.23-rc1-mm2-005_freepages_zonelist/include/linux/swap.h 2007-08-08 11:35:00.000000000 +0100 @@ -189,7 +189,7 @@ extern int rotate_reclaimable_page(struc extern void swap_setup(void); /* linux/mm/vmscan.c */ -extern unsigned long try_to_free_pages(struct zone **zones, int order, +extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, gfp_t gfp_mask); extern unsigned long shrink_all_memory(unsigned long nr_pages); extern int vm_swappiness; diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.23-rc1-mm2-clean/mm/page_alloc.c linux-2.6.23-rc1-mm2-005_freepages_zonelist/mm/page_alloc.c --- linux-2.6.23-rc1-mm2-clean/mm/page_alloc.c 2007-08-07 14:45:11.000000000 +0100 +++ linux-2.6.23-rc1-mm2-005_freepages_zonelist/mm/page_alloc.c 2007-08-08 11:35:00.000000000 +0100 @@ -1644,7 +1644,7 @@ nofail_alloc: reclaim_state.reclaimed_slab = 0; p->reclaim_state = &reclaim_state; - did_some_progress = try_to_free_pages(zonelist->zones, order, gfp_mask); + did_some_progress = try_to_free_pages(zonelist, order, gfp_mask); p->reclaim_state = NULL; p->flags &= ~PF_MEMALLOC; diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.23-rc1-mm2-clean/mm/vmscan.c linux-2.6.23-rc1-mm2-005_freepages_zonelist/mm/vmscan.c --- linux-2.6.23-rc1-mm2-clean/mm/vmscan.c 2007-08-07 14:45:11.000000000 +0100 +++ linux-2.6.23-rc1-mm2-005_freepages_zonelist/mm/vmscan.c 2007-08-08 11:35:00.000000000 +0100 @@ -1127,7 +1127,8 @@ static unsigned long shrink_zones(int pr * holds filesystem locks which prevent writeout this might not work, and the * allocation attempt will fail. */ -unsigned long try_to_free_pages(struct zone **zones, int order, gfp_t gfp_mask) +unsigned long try_to_free_pages(struct zonelist *zonelist, int order, + gfp_t gfp_mask) { int priority; int ret = 0; @@ -1135,6 +1136,7 @@ unsigned long try_to_free_pages(struct z unsigned long nr_reclaimed = 0; struct reclaim_state *reclaim_state = current->reclaim_state; unsigned long lru_pages = 0; + struct zone **zones = zonelist->zones; int i; struct scan_control sc = { .gfp_mask = gfp_mask, - 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/