linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mel@csn.ul.ie>
To: linux-mm@kvack.org
Cc: Mel Gorman <mel@csn.ul.ie>,
	linux-kernel@vger.kernel.org, lhms-devel@lists.sourceforge.net
Subject: [PATCH 9/9] ForTesting - Drain the per-cpu caches with high order allocations fail
Date: Thu, 26 Jan 2006 18:46:05 +0000 (GMT)	[thread overview]
Message-ID: <20060126184605.8550.1746.sendpatchset@skynet.csn.ul.ie> (raw)
In-Reply-To: <20060126184305.8550.94358.sendpatchset@skynet.csn.ul.ie>

The presense of free per-cpu pages appear to cause fragmentation because
contiguous free blocks do not merge with their buddies. This can skew the
results between runs a lot because how many HugeTLB pages there are available
depends on luck. This patch was applied to both stock and anti-frag kernels
to give more consistant results.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.16-rc1-mm3-902_highorderoom/mm/page_alloc.c linux-2.6.16-rc1-mm3-903_drainpercpu/mm/page_alloc.c
--- linux-2.6.16-rc1-mm3-902_highorderoom/mm/page_alloc.c	2006-01-26 18:15:07.000000000 +0000
+++ linux-2.6.16-rc1-mm3-903_drainpercpu/mm/page_alloc.c	2006-01-26 18:15:49.000000000 +0000
@@ -623,7 +623,8 @@ void drain_remote_pages(void)
 }
 #endif
 
-#if defined(CONFIG_PM) || defined(CONFIG_HOTPLUG_CPU)
+#if defined(CONFIG_PM) || \
+	defined(CONFIG_HOTPLUG_CPU)
 static void __drain_pages(unsigned int cpu)
 {
 	unsigned long flags;
@@ -685,6 +686,27 @@ void drain_local_pages(void)
 	__drain_pages(smp_processor_id());
 	local_irq_restore(flags);	
 }
+
+void smp_drain_local_pages(void *arg)
+{
+	drain_local_pages();
+}
+
+/*
+ * Spill all the per-cpu pages from all CPUs back into the buddy allocator
+ */
+void drain_all_local_pages(void)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	__drain_pages(smp_processor_id());
+	local_irq_restore(flags);
+
+	smp_call_function(smp_drain_local_pages, NULL, 0, 1);
+}
+#else
+void drain_all_local_pages(void) {}
 #endif /* CONFIG_PM */
 
 static void zone_statistics(struct zonelist *zonelist, struct zone *z, int cpu)
@@ -1073,6 +1095,9 @@ rebalance:
 
 	did_some_progress = try_to_free_pages(zonelist->zones, gfp_mask);
 
+	if (order > 3)
+		drain_all_local_pages();
+
 	p->reclaim_state = NULL;
 	p->flags &= ~PF_MEMALLOC;
 

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2006-01-26 18:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-26 18:43 [PATCH 0/9] Reducing fragmentation using zones v4 Mel Gorman
2006-01-26 18:43 ` [PATCH 1/9] Add __GFP_EASYRCLM flag and update callers Mel Gorman
2006-01-26 18:43 ` [PATCH 2/9] Create the ZONE_EASYRCLM zone Mel Gorman
2006-01-26 18:44 ` [PATCH 3/9] x86 - Specify amount of kernel memory at boot time Mel Gorman
2006-01-26 18:44 ` [PATCH 4/9] ppc64 " Mel Gorman
2006-02-07 21:06   ` [Lhms-devel] " Joel Schopp
2006-02-08 10:23     ` Mel Gorman
2006-01-26 18:44 ` [PATCH 5/9] At boot, determine what zone memory will hot-add to Mel Gorman
2006-01-26 18:45 ` [PATCH 6/9] Allow HugeTLB allocations to use ZONE_EASYRCLM Mel Gorman
2006-01-26 18:45 ` [PATCH 7/9] Add documentation for extra boot parameters Mel Gorman
2006-01-26 18:45 ` [PATCH 8/9] ForTesting - Prevent OOM killer firing for high-order allocations Mel Gorman
2006-01-26 18:46 ` Mel Gorman [this message]
2006-01-27  0:29 ` [PATCH 0/9] Reducing fragmentation using zones v4 KAMEZAWA Hiroyuki
2006-01-27  0:41   ` [Lhms-devel] " KAMEZAWA Hiroyuki
2006-01-27 10:29     ` Mel Gorman
2006-01-27 11:19       ` KAMEZAWA Hiroyuki
2006-01-27 11:42         ` 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=20060126184605.8550.1746.sendpatchset@skynet.csn.ul.ie \
    --to=mel@csn.ul.ie \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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