From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: linux-mm@kvack.org
Subject: Re: [RFC][PATCH 0/6] CART Implementation
Date: Sun, 28 Aug 2005 10:03:30 +0200 [thread overview]
Message-ID: <1125216210.20161.104.camel@twins> (raw)
In-Reply-To: <20050828002519.GA26764@dmt.cnet>
On Sat, 2005-08-27 at 21:25 -0300, Marcelo Tosatti wrote:
>
> +/* This function selects the candidate and returns the corresponding
> + * struct page * or returns NULL in case no page can be freed.
> + */
> +struct page *__cart_replace(struct zone *zone)
> +{
> + struct page *page;
> + int referenced;
> +
> + while (!list_empty(list_T2)) {
> + page = list_entry(list_T2->next, struct page, lru);
> +
> + if (!page_referenced(page, 0, 0))
> + break;
> +
> + del_page_from_inactive_list(zone, page);
> + add_page_to_active_tail(zone, page);
> + SetPageActive(page);
> +
> + cart_q_inc(zone);
> + }
>
> If you find an unreferenced page in the T2 list you don't keep a reference
> to it performing a search on the T1 list below? That looks bogus.
If the loop breaks (unreferenced page) the head page of T2 is the one.
All other pages are moved to the tail of T1, as per the Paper.
> Apart from that, both while (!list_empty(list_T2)) are problematic. If there
> are tons of referenced pages you simply loop, unlimited?
No, max |T2| times, after that the list is simply empty. As for the
other loop, that can run the initial |T1| times until it encounteres the
first page put on the list by the previous loop, or untill it made a
full loop. page_referenced() clears the flag right?
> And what about
> the lru lock required for dealing with page->lru ?
As the __ prefix in the name suggests it is run under zone->lru_lock.
I'll some comments.
> Look at the original algorithm: it grabs SWAP_CLUSTER_MAX pages from the inactive
> list, puts them into a CPU local list (on the stack), releases the lru lock,
> and works on the isolated pages. You want something similar.
I do, look at patch 6 where I put this thing into action.
isolate_lru_pages() is modified to remove nr_to_scan = SWAP_CLUSTER_MAX
pages from the lists. From there on it is similar to the current code.
> As for testing, STP is really easy:
>
> http://www.osdl.org/lab_activities/kernel_testing/stp
>
Thanks, I'll have a look.
Kind regards,
--
Peter Zijlstra <a.p.zijlstra@chello.nl>
--
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>
prev parent reply other threads:[~2005-08-28 8:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-27 21:57 a.p.zijlstra
2005-08-27 21:57 ` [RFC][PATCH 1/6] " a.p.zijlstra
2005-08-27 21:57 ` [RFC][PATCH 2/6] " a.p.zijlstra
2005-08-29 3:02 ` Rik van Riel
2005-08-29 4:15 ` Peter Zijlstra
2005-08-29 6:20 ` Peter Zijlstra
2005-08-27 21:57 ` [RFC][PATCH 3/6] " a.p.zijlstra
2005-08-27 21:58 ` [RFC][PATCH 4/6] " a.p.zijlstra
2005-08-27 21:58 ` [RFC][PATCH 5/6] " a.p.zijlstra
2005-08-27 21:58 ` [RFC][PATCH 6/6] " a.p.zijlstra
2005-08-28 0:25 ` [RFC][PATCH 0/6] " Marcelo Tosatti
2005-08-28 8:03 ` Peter Zijlstra [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=1125216210.20161.104.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=linux-mm@kvack.org \
--cc=marcelo.tosatti@cyclades.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