[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1107201617050.1472@router.home>
Date: Wed, 20 Jul 2011 16:17:41 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Mel Gorman <mgorman@...e.de>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Minchan Kim <minchan.kim@...il.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] mm: page allocator: Initialise ZLC for first zone
eligible for zone_reclaim
Hmmm... Maybe we can bypass the checks?
Subject: [page allocator] Do not check watermarks if there is a page available on the per cpu freelists
One should be able to grab a page from the per cpu freelists if available.
The pages on the per cpu freelists are not accounted for in VM statistics
so getting a page from there has no impact on reclaim.
Check for this condition in get_page_from_freelist and short circuit
to the call to buffered_rmqueue if so.
Note that there is a race here. We may deplete the reserve pools by
one page if either the process is rescheduled on a different processor
or if another process grabs the last page from the per cpu freelist.
Signed-off-by: Christoph Lameter <cl@...ux.com>
---
mm/page_alloc.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c 2011-07-20 15:27:20.544825852 -0500
+++ linux-2.6/mm/page_alloc.c 2011-07-20 15:30:05.314824797 -0500
@@ -1666,6 +1666,16 @@ zonelist_scan:
!cpuset_zone_allowed_softwall(zone, gfp_mask))
goto try_next_zone;
+ /*
+ * Short circuit allocation if we have a usable object on
+ * the percpu freelist. Note that this can only be an
+ * optimization since there is no guarantee that we will
+ * be executing on the same cpu. Another process could also
+ * be scheduled and take the available page from us.
+ */
+ if (order == 0 && this_cpu_read(zone->pageset->pcp.count))
+ goto try_this_zone;
+
BUILD_BUG_ON(ALLOC_NO_WATERMARKS < NR_WMARK);
if (!(alloc_flags & ALLOC_NO_WATERMARKS)) {
unsigned long mark;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists