linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@engr.sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	nickpiggin@yahoo.com.au, linux-mm@kvack.org
Subject: Re: Get rid of scan_control
Date: Sat, 11 Feb 2006 11:01:00 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.62.0602111054520.24060@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20060211013255.20832152.akpm@osdl.org>

On Sat, 11 Feb 2006, Andrew Morton wrote:

> > But refill_inactive_list() is not used for swapping only. All evicted 
> > pages go through that path - it can be _very_ hot.
> 
> A bit hot.  I guess it's worth fixing.

There is another issue of the anon_vma lock getting very hot during 
zone_reclaim() because refill_inactive_list calls page_referenced(). So 
does shrink_list(). zone_reclaim is only interested in unmapped pages and 
thus checking for references is useless.

> scan_control was modelled on writeback_control.  But writeback_control
> works, and scan_control doesn't.  I think this is because a)
> writeback_control instances are always initialised at the declaration site
> and b) writeback_control is just a lot simpler.

The zoned counter patchset eliminates at least the wbs structure.

Patch to fix the calling of page_referenced() follows. This is against 
2.6.16-rc2. We probably need another patch for current mm. In the case
of VMSCAN_MAY_SWAP not set, we may just want to bypass the whole 
calculation thing for reclaim_mapped.





Do not check references to a page during zone reclaim

Shrink_list and refill_inactive() check all ptes pointing to a page
for reference bits in order to decide if the page should be put on
the active list. This is not necessary for zone_reclaim since we
are only interested in removing unmapped pages. Skip the checks in both
functions.

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

Index: linux/mm/vmscan.c
===================================================================
--- linux.orig/mm/vmscan.c	2006-02-10 12:15:37.293298891 -0800
+++ linux/mm/vmscan.c	2006-02-10 12:26:19.453541327 -0800
@@ -443,6 +443,10 @@ static int shrink_list(struct list_head 
 		BUG_ON(PageActive(page));
 
 		sc->nr_scanned++;
+
+		if (!sc->may_swap && page_mapped(page))
+			goto keep_locked;
+
 		/* Double the slab pressure for mapped and swapcache pages */
 		if (page_mapped(page) || PageSwapCache(page))
 			sc->nr_scanned++;
@@ -983,7 +987,7 @@ refill_inactive_zone(struct zone *zone, 
 	 * Now use this metric to decide whether to start moving mapped memory
 	 * onto the inactive list.
 	 */
-	if (swap_tendency >= 100)
+	if (swap_tendency >= 100 && sc->may_swap)
 		reclaim_mapped = 1;
 
 	while (!list_empty(&l_hold)) {

--
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-02-11 19:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-10  5:02 Christoph Lameter
2006-02-11  4:53 ` Marcelo Tosatti
2006-02-11  9:32   ` Andrew Morton
2006-02-11  9:46     ` Andrew Morton
2006-02-12  3:33       ` Nick Piggin
2006-02-12  3:47         ` Christoph Lameter
2006-02-12  4:08           ` Nick Piggin
2006-02-12  4:41             ` Christoph Lameter
2006-02-12  5:01               ` Nick Piggin
2006-02-12  5:14                 ` Andrew Morton
2006-02-12  5:37                   ` Andrew Morton
2006-02-12  6:49                     ` Christoph Lameter
2006-02-12  7:53                       ` Andrew Morton
2006-02-13 17:54                         ` Christoph Lameter
2006-02-12  6:25                 ` Christoph Lameter
2006-02-11 19:01     ` Christoph Lameter [this message]
2006-02-11 21:13       ` Andrew Morton
2006-02-11 21:27         ` Christoph Lameter

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=Pine.LNX.4.62.0602111054520.24060@schroedinger.engr.sgi.com \
    --to=clameter@engr.sgi.com \
    --cc=akpm@osdl.org \
    --cc=linux-mm@kvack.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=nickpiggin@yahoo.com.au \
    /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