mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: linux-kernel@vger.kernel.org
Cc: steiner@sgi.com, ak@suse.de, Wu Fengguang <wfg@mail.ustc.edu.cn>,
	Christoph Lameter <clameter@sgi.com>,
	linux-mm@vger.kernel.org, Martin Hicks <mort@bork.org>
Subject: Zone reclaim V4 [3/3]: Alternate logic without zoned counters
Date: Wed, 21 Dec 2005 13:08:33 -0800 (PST)	[thread overview]
Message-ID: <20051221210833.3354.50872.sendpatchset@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20051221210823.3354.53223.sendpatchset@schroedinger.engr.sgi.com>

Reduce frequency of unsuccessful zone reclaim attempts

This is a fallback patch if zoned vm counters are not available. In that
case no check for reclaimable pages can be made before starting the scan.

The scan may have to occur for every off node allocation once the node
is full. In order to deal with that situation we note the last time a
scan has failed and only retry once per tick.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.15-rc5-mm2/mm/vmscan.c
===================================================================
--- linux-2.6.15-rc5-mm2.orig/mm/vmscan.c	2005-12-12 16:50:20.000000000 -0800
+++ linux-2.6.15-rc5-mm2/mm/vmscan.c	2005-12-12 16:50:21.000000000 -0800
@@ -1842,6 +1842,16 @@ int zone_reclaim(struct zone *zone, gfp_
 	    atomic_read(&zone->reclaim_in_progress) > 0)
 		return 0;
 
+	/*
+	 * If an unsuccessful zone reclaim occurred in this tick then we
+	 * already needed to go off before. Our local purity is already
+	 * tainted and its likely that the scan for easily reclaimable pages
+	 * will be a waste of time. Continue off node allocations for the
+	 * duration of this tick.
+	 */
+	if (zone->last_unsuccessful_zone_reclaim == jiffies)
+		return 0;
+
 	sc.gfp_mask = gfp_mask;
 	sc.may_writepage = 0;
 	sc.nr_mapped = read_page_state(nr_mapped);
@@ -1859,6 +1869,8 @@ int zone_reclaim(struct zone *zone, gfp_
 	shrink_zone(zone, &sc);
 	p->reclaim_state = NULL;
 	current->flags &= ~PF_MEMALLOC;
+	if (sc.nr_reclaimed == 0)
+		zone->last_unsuccessful_zone_reclaim = jiffies;
 	cond_resched();
 	return sc.nr_reclaimed >= (1 << order);
 }
Index: linux-2.6.15-rc5-mm2/include/linux/mmzone.h
===================================================================
--- linux-2.6.15-rc5-mm2.orig/include/linux/mmzone.h	2005-12-12 09:10:34.000000000 -0800
+++ linux-2.6.15-rc5-mm2/include/linux/mmzone.h	2005-12-12 16:50:21.000000000 -0800
@@ -157,6 +157,8 @@ struct zone {
 	/* A count of how many reclaimers are scanning this zone */
 	atomic_t		reclaim_in_progress;
 
+	unsigned long		last_unsuccessful_zone_reclaim;
+
 	/*
 	 * prev_priority holds the scanning priority for this zone.  It is
 	 * defined as the scanning priority at which we achieved our reclaim

      parent reply	other threads:[~2005-12-21 21:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-21 21:08 Zone reclaim V4 [1/3]: resurrect may_swap Christoph Lameter
2005-12-21 21:08 ` Zone reclaim V4 [2/3]: Reclaim logic based on zoned counters Christoph Lameter
2005-12-21 21:08 ` Christoph Lameter [this message]

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=20051221210833.3354.50872.sendpatchset@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@vger.kernel.org \
    --cc=mort@bork.org \
    --cc=steiner@sgi.com \
    --cc=wfg@mail.ustc.edu.cn \
    /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

Powered by JetHome