From: Christoph Lameter <clameter@engr.sgi.com>
To: Peter Zijlstra <peter@programming.kicks-ass.net>
Cc: akpm@osdl.org, Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
Mike Kravetz <kravetz@us.ibm.com>,
Ray Bryant <raybry@mpdtxmail.amd.com>,
Lee Schermerhorn <lee.schermerhorn@hp.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Magnus Damm <magnus.damm@gmail.com>, Paul Jackson <pj@sgi.com>,
Dave Hansen <haveblue@us.ibm.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: [PATCH 1/5] Swap Migration V4: LRU operations
Date: Wed, 26 Oct 2005 09:44:58 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.62.0510260943330.12433@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <1130319083.17653.37.camel@localhost.localdomain>
On Wed, 26 Oct 2005, Peter Zijlstra wrote:
> On Tue, 2005-10-25 at 12:30 -0700, Christoph Lameter wrote:
>
> > + if (rc == -1) { /* Not possible to isolate */
> > + list_del(&page->lru);
> > + list_add(&page->lru, src);
> > }
>
> Would the usage of list_move() not be simpler?
Hmmm. yes the whole section is a bit weird there (sorry Magnus). How
about this additional patch:
Index: linux-2.6.14-rc5-mm1/mm/vmscan.c
===================================================================
--- linux-2.6.14-rc5-mm1.orig/mm/vmscan.c 2005-10-25 08:09:52.000000000 -0700
+++ linux-2.6.14-rc5-mm1/mm/vmscan.c 2005-10-26 09:42:34.000000000 -0700
@@ -590,22 +590,22 @@ static int isolate_lru_pages(struct zone
{
struct page *page;
int scanned = 0;
- int rc;
while (scanned++ < nr_to_scan && !list_empty(src)) {
page = lru_to_page(src);
prefetchw_prev_lru_page(page, src, flags);
- rc = __isolate_lru_page(zone, page);
-
- BUG_ON(rc == 0); /* PageLRU(page) must be true */
-
- if (rc == 1) /* Succeeded to isolate page */
+ switch (__isolate_lru_page(zone, page)) {
+ case 1:
+ /* Succeeded to isolate page */
list_add(&page->lru, dst);
-
- if (rc == -1) { /* Not possible to isolate */
- list_del(&page->lru);
- list_add(&page->lru, src);
+ break;
+ case -1:
+ /* Not possible to isolate */
+ list_move(&page->lru, src);
+ break;
+ default:
+ BUG();
}
}
--
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>
next prev parent reply other threads:[~2005-10-26 16:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-25 19:30 [PATCH 0/5] Swap Migration V4: Overview Christoph Lameter
2005-10-25 19:30 ` [PATCH 1/5] Swap Migration V4: LRU operations Christoph Lameter
2005-10-26 9:31 ` Peter Zijlstra
2005-10-26 16:44 ` Christoph Lameter [this message]
2005-10-25 19:30 ` [PATCH 2/5] Swap Migration V4: PF_SWAPWRITE to allow writing to swap Christoph Lameter
2005-10-25 19:30 ` [PATCH 3/5] Swap Migration V4: migrate_pages() function Christoph Lameter
2005-10-26 7:15 ` Dave Hansen
2005-10-26 16:48 ` Christoph Lameter
2005-10-25 19:30 ` [PATCH 4/5] Swap Migration V4: MPOL_MF_MOVE interface Christoph Lameter
2005-10-25 19:30 ` [PATCH 5/5] Swap Migration V4: sys_migrate_pages interface 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.0510260943330.12433@schroedinger.engr.sgi.com \
--to=clameter@engr.sgi.com \
--cc=akpm@osdl.org \
--cc=haveblue@us.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kravetz@us.ibm.com \
--cc=lee.schermerhorn@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=magnus.damm@gmail.com \
--cc=marcelo.tosatti@cyclades.com \
--cc=peter@programming.kicks-ass.net \
--cc=pj@sgi.com \
--cc=raybry@mpdtxmail.amd.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