From: Magnus Damm <magnus.damm@gmail.com>
To: Christoph Lameter <clameter@engr.sgi.com>
Cc: akpm@osdl.org, linux-mm@kvack.org,
lhms-devel@lists.sourceforge.net, ak@suse.de
Subject: Re: [PATCH 1/2] Page migration via Swap V2: Page Eviction
Date: Wed, 19 Oct 2005 19:04:08 +0900 [thread overview]
Message-ID: <aec7e5c30510190304y3a1935e5k57ddd8912b4e411a@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0510180938430.7911@schroedinger.engr.sgi.com>
On 10/19/05, Christoph Lameter <clameter@engr.sgi.com> wrote:
> On Tue, 18 Oct 2005, Magnus Damm wrote:
>
> > This function is very similar to isolate_lru_pages(), except that it
> > operates on one page at a time and drains the lru if needed. Maybe
> > isolate_lru_pages() could use this function (inline) if the spinlock
> > and drain code was moved out?
>
> isolate_lru_pages operates on batches of pages from the same zone and is
> very efficient by only taking a single lock. It also does not drain other
> processors LRUs.
Ah, I see. You have a mix of pages from different zones on your list.
Maybe it is possible to use the same kind of zone locking style as
release_pages() to avoid duplicating code...
> > I'm also curios why you choose to always use list_del() and move back
> > the page if freed elsewhere, instead of using
> > del_page_from_[in]active_list(). I guess because of performance. But
> > if that is the case, wouldn't it make sense to do as little as
> > possible with the spinlock held, ie move list_add() (when rc == 1) out
> > of the function?
>
> I tried to follow isolate_lru_pages as closely as possible. list_add() is
> a simple operation and so I left it inside following some earlier code
> from the hotplug project.
Yep, it probably won't matter.
I'm trying to figure out if this code works in all cases:
+ spin_lock_irq(&zone->lru_lock);
+ list_del(&page->lru);
+ if (!TestSetPageLRU(page)) {
+ if (PageActive(page))
+ add_page_to_active_list(zone, page);
+ else
+ add_page_to_inactive_list(zone, page);
+ count++;
+ }
+ spin_unlock_irq(&zone->lru_lock);
Why not use if (TestSetPageLRU(page)) BUG()?
Or is it possible that someone sets the LRU bit while we are keeping
the pages on our non-lru list? If so, who is stealing and will your
put_page() patch work correctly if the page is stolen from us?
Thanks,
/ magnus
--
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-19 10:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-18 0:49 [PATCH 0/2] Page migration via Swap V2: Overview Christoph Lameter
2005-10-18 0:49 ` [PATCH 1/2] Page migration via Swap V2: Page Eviction Christoph Lameter
2005-10-18 1:04 ` Andrew Morton
2005-10-18 8:51 ` Nick Piggin
2005-10-18 16:38 ` Christoph Lameter
2005-10-18 8:34 ` Magnus Damm
2005-10-18 16:43 ` Christoph Lameter
2005-10-19 10:04 ` Magnus Damm [this message]
2005-10-19 15:29 ` Christoph Lameter
2005-10-19 20:32 ` Christoph Lameter
2005-10-18 0:49 ` [PATCH 2/2] Page migration via Swap V2: MPOL_MF_MOVE interface Christoph Lameter
2005-10-18 10:05 ` Magnus Damm
2005-10-18 16:46 ` Christoph Lameter
2005-10-18 3:18 ` [PATCH 0/2] Page migration via Swap V2: Overview KAMEZAWA Hiroyuki
2005-10-18 14:27 ` [Lhms-devel] " Lee Schermerhorn
2005-10-18 16:47 ` Christoph Lameter
2005-10-18 6:37 ` KAMEZAWA Hiroyuki
2005-10-18 16:50 ` Christoph Lameter
2005-10-18 12:16 ` Marcelo Tosatti
2005-10-18 16:54 ` 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=aec7e5c30510190304y3a1935e5k57ddd8912b4e411a@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=clameter@engr.sgi.com \
--cc=lhms-devel@lists.sourceforge.net \
--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