From: Christoph Lameter <cl@linux.com>
To: Mel Gorman <mgorman@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan.kim@gmail.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mm: page allocator: Initialise ZLC for first zone eligible for zone_reclaim
Date: Wed, 20 Jul 2011 16:17:41 -0500 (CDT) [thread overview]
Message-ID: <alpine.DEB.2.00.1107201617050.1472@router.home> (raw)
In-Reply-To: <alpine.DEB.2.00.1107201443400.1472@router.home>
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@linux.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, 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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-07-20 21:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 15:08 [PATCH 0/2] Reduce frequency of stalls due to zone_reclaim() on NUMA v2r1 Mel Gorman
2011-07-15 15:08 ` [PATCH 1/2] mm: page allocator: Initialise ZLC for first zone eligible for zone_reclaim Mel Gorman
2011-07-18 14:56 ` Christoph Lameter
2011-07-18 16:05 ` Mel Gorman
2011-07-18 17:20 ` Christoph Lameter
2011-07-18 21:13 ` Mel Gorman
2011-07-18 21:54 ` Christoph Lameter
2011-07-19 14:01 ` Christoph Lameter
2011-07-20 18:08 ` Christoph Lameter
2011-07-20 19:18 ` Mel Gorman
2011-07-20 19:28 ` Christoph Lameter
2011-07-20 19:52 ` Christoph Lameter
2011-07-20 21:17 ` Christoph Lameter [this message]
2011-07-20 22:48 ` Mel Gorman
2011-07-21 15:24 ` Christoph Lameter
2011-07-15 15:09 ` [PATCH 2/2] mm: page allocator: Reconsider zones for allocation after direct reclaim Mel Gorman
2011-07-19 11:46 ` [PATCH] mm: page allocator: Reconsider zones for allocation after direct reclaim fix Mel Gorman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.1107201617050.1472@router.home \
--to=cl@linux.com \
--cc=akpm@linux-foundation.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan.kim@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox