From: Marcelo <marcelo.tosatti@cyclades.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org
Subject: Re: [PATCH 3/7] CART - an advanced page replacement policy
Date: Fri, 30 Sep 2005 15:44:04 -0300 [thread overview]
Message-ID: <20050930184404.GA16812@xeon.cnet> (raw)
In-Reply-To: <20050929181622.780879649@twins>
Hi Peter,
On Thu, Sep 29, 2005 at 08:08:48PM +0200, Peter Zijlstra wrote:
> The flesh of the CART implementation. Again comments in the file should be
> clear.
Having per-zone "B1" target accounted at fault-time instead of a global target
strikes me.
The ARC algorithm adjusts the B1 target based on the fact that being-faulted-pages
were removed from the same memory region where such pages will reside.
The per-zone "B1" target as you implement it means that the B1 target accounting
happens for the zone in which the page for the faulting data has been allocated,
_not_ on the zone from which the data has been evicted. Seems quite unfair.
So for example, if a page gets removed from the HighMem zone while in the
B1 list, and the same data gets faulted in later on a page from the normal
zone, Normal will have its "B1" target erroneously increased.
A global inactive target scaled to the zone size would get rid of that problem.
Another issue is testing: You had some very interesting numbers before,
how are things now?
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
>
> mm/cart.c | 631 +++++++++++++++++++++++++++++++++++++++++++++
> 7 files changed, 682 insertions(+), 35 deletions(-)
>
> Index: linux-2.6-git/mm/cart.c
> ===================================================================
> --- /dev/null
> +++ linux-2.6-git/mm/cart.c
> @@ -0,0 +1,639 @@
<snip>
> +#define cart_cT ((zone)->nr_active + (zone)->nr_inactive + (zone)->free_pages)
> +#define cart_cB ((zone)->present_pages)
> +
> +#define T2B(x) (((x) * cart_cB) / cart_cT)
> +#define B2T(x) (((x) * cart_cT) / cart_cB)
> +
> +#define size_T1 ((zone)->nr_active)
> +#define size_T2 ((zone)->nr_inactive)
> +
> +#define list_T1 (&(zone)->active_list)
> +#define list_T2 (&(zone)->inactive_list)
> +
> +#define cart_p ((zone)->nr_p)
> +#define cart_q ((zone)->nr_q)
> +
> +#define size_B1 ((zone)->nr_evicted_active)
> +#define size_B2 ((zone)->nr_evicted_inactive)
> +
> +#define nr_Ns ((zone)->nr_shortterm)
> +#define nr_Nl (size_T1 + size_T2 - nr_Ns)
These defines are not not easy to read inside the code which
uses them, I personally think that "zone->nr_.." explicitly is
much clearer.
WARNING: multiple messages have this Message-ID (diff)
From: Marcelo <marcelo.tosatti@cyclades.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org
Subject: Re: [PATCH 3/7] CART - an advanced page replacement policy
Date: Fri, 30 Sep 2005 15:44:04 -0300 [thread overview]
Message-ID: <20050930184404.GA16812@xeon.cnet> (raw)
In-Reply-To: <20050929181622.780879649@twins>
Hi Peter,
On Thu, Sep 29, 2005 at 08:08:48PM +0200, Peter Zijlstra wrote:
> The flesh of the CART implementation. Again comments in the file should be
> clear.
Having per-zone "B1" target accounted at fault-time instead of a global target
strikes me.
The ARC algorithm adjusts the B1 target based on the fact that being-faulted-pages
were removed from the same memory region where such pages will reside.
The per-zone "B1" target as you implement it means that the B1 target accounting
happens for the zone in which the page for the faulting data has been allocated,
_not_ on the zone from which the data has been evicted. Seems quite unfair.
So for example, if a page gets removed from the HighMem zone while in the
B1 list, and the same data gets faulted in later on a page from the normal
zone, Normal will have its "B1" target erroneously increased.
A global inactive target scaled to the zone size would get rid of that problem.
Another issue is testing: You had some very interesting numbers before,
how are things now?
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
>
> mm/cart.c | 631 +++++++++++++++++++++++++++++++++++++++++++++
> 7 files changed, 682 insertions(+), 35 deletions(-)
>
> Index: linux-2.6-git/mm/cart.c
> ===================================================================
> --- /dev/null
> +++ linux-2.6-git/mm/cart.c
> @@ -0,0 +1,639 @@
<snip>
> +#define cart_cT ((zone)->nr_active + (zone)->nr_inactive + (zone)->free_pages)
> +#define cart_cB ((zone)->present_pages)
> +
> +#define T2B(x) (((x) * cart_cB) / cart_cT)
> +#define B2T(x) (((x) * cart_cT) / cart_cB)
> +
> +#define size_T1 ((zone)->nr_active)
> +#define size_T2 ((zone)->nr_inactive)
> +
> +#define list_T1 (&(zone)->active_list)
> +#define list_T2 (&(zone)->inactive_list)
> +
> +#define cart_p ((zone)->nr_p)
> +#define cart_q ((zone)->nr_q)
> +
> +#define size_B1 ((zone)->nr_evicted_active)
> +#define size_B2 ((zone)->nr_evicted_inactive)
> +
> +#define nr_Ns ((zone)->nr_shortterm)
> +#define nr_Nl (size_T1 + size_T2 - nr_Ns)
These defines are not not easy to read inside the code which
uses them, I personally think that "zone->nr_.." explicitly is
much clearer.
--
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-09-30 18:46 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-29 18:08 [PATCH 0/7] CART - an advanced page replacement policy Peter Zijlstra
2005-09-29 18:08 ` Peter Zijlstra
2005-09-29 18:08 ` [PATCH 1/7] " Peter Zijlstra
2005-09-29 18:08 ` Peter Zijlstra
2005-09-29 18:08 ` [PATCH 2/7] " Peter Zijlstra
2005-09-29 18:08 ` Peter Zijlstra
2005-09-29 18:08 ` [PATCH 3/7] " Peter Zijlstra
2005-09-29 18:08 ` Peter Zijlstra
2005-09-30 18:44 ` Marcelo [this message]
2005-09-30 18:44 ` Marcelo
2005-09-30 19:16 ` Peter Zijlstra
2005-09-30 19:16 ` Peter Zijlstra
2005-09-30 19:27 ` Peter Zijlstra
2005-09-30 19:27 ` Peter Zijlstra
2005-09-29 18:08 ` [PATCH 4/7] " Peter Zijlstra
2005-09-29 18:08 ` Peter Zijlstra
2005-09-29 18:08 ` [PATCH 5/7] " Peter Zijlstra
2005-09-29 18:08 ` Peter Zijlstra
2005-09-29 18:08 ` [PATCH 6/7] " Peter Zijlstra
2005-09-29 18:08 ` Peter Zijlstra
2005-09-29 18:08 ` [PATCH 7/7] " Peter Zijlstra
2005-09-29 18:08 ` Peter Zijlstra
2005-09-29 19:40 ` [PATCH 0/7] " Bill Davidsen
2005-09-29 19:40 ` Bill Davidsen
2005-09-30 15:26 ` Peter Zijlstra
2005-09-30 15:26 ` Peter Zijlstra
2005-10-01 2:41 ` Bill Davidsen
2005-10-01 2:41 ` Bill Davidsen
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=20050930184404.GA16812@xeon.cnet \
--to=marcelo.tosatti@cyclades.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.