mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: akpm@osdl.org
Cc: lhms-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	Christoph Lameter <clameter@sgi.com>
Subject: [PATCH 3/4] SwapMig: Drop unused pages immediately
Date: Thu, 17 Nov 2005 17:03:07 -0800 (PST)	[thread overview]
Message-ID: <20051118010307.22328.49242.sendpatchset@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20051118010257.22328.49524.sendpatchset@schroedinger.engr.sgi.com>

Drop unused pages immediately

If a page is encountered that is only referenced by the migration code
then there is no reason to swap or migrate the page. Release
the page by calling move_to_lru().

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

Index: linux-2.6.15-rc1-mm1/mm/vmscan.c
===================================================================
--- linux-2.6.15-rc1-mm1.orig/mm/vmscan.c	2005-11-17 15:59:07.000000000 -0800
+++ linux-2.6.15-rc1-mm1/mm/vmscan.c	2005-11-17 16:05:18.000000000 -0800
@@ -700,6 +700,11 @@ redo:
 	list_for_each_entry_safe(page, page2, l, lru) {
 		cond_resched();
 
+		if (page_count(page) == 1) {
+			/* page was freed from under us. So we are done. */
+			move_to_lru(page);
+			continue;
+		}
 		/*
 		 * Skip locked pages during the first two passes to give the
 		 * functions holding the lock time to release the page. Later we

  parent reply	other threads:[~2005-11-18  1:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-18  1:02 [PATCH 1/4] SwapMig: [resend] CONFIG_MIGRATION fixes Christoph Lameter
2005-11-18  1:03 ` [PATCH 2/4] SwapMig: add_to_swap() avoid atomic allocations Christoph Lameter
2005-11-18  1:03 ` Christoph Lameter [this message]
2005-11-18  1:03 ` [PATCH 4/4] SwapMig: Extend parameters for migrate_pages() 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=20051118010307.22328.49242.sendpatchset@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@osdl.org \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome