From: Nick Piggin <piggin@cyberone.com.au>
To: linux-kernel <linux-kernel@vger.kernel.org>,
Linux Memory Management <linux-mm@kvack.org>
Subject: Re: [RFC][PATCH 4/4] vm-mapped-x-active-lists
Date: Tue, 09 Mar 2004 16:39:00 +1100 [thread overview]
Message-ID: <404D5874.2060108@cyberone.com.au> (raw)
In-Reply-To: <404D5784.9080004@cyberone.com.au>
Nick Piggin wrote:
>
>@@ -714,14 +737,27 @@ shrink_zone(struct zone *zone, int max_s
> * just to make sure that the kernel will slowly sift through the
> * active list.
> */
>- ratio = (unsigned long)SWAP_CLUSTER_MAX * zone->nr_active /
>- ((zone->nr_inactive | 1) * 2);
>+ nr_active = zone->nr_active_mapped + zone->nr_active_unmapped;
>+ ratio = (unsigned long)SWAP_CLUSTER_MAX * nr_active /
>+ (zone->nr_inactive * 2 + 1);
>+ mapped_ratio = (unsigned long long)ratio * nr_active;
>+ do_div(mapped_ratio, zone->nr_active_mapped+1);
>
Just for information, this is where you would balance mapped vs unmapped
pages: do_div(mapped_ratio, 16); /* mapped pages are worth 16 times
more */
>+
>+ ratio = ratio - mapped_ratio;
>+ atomic_add(ratio+1, &zone->nr_scan_active_unmapped);
>+ count = atomic_read(&zone->nr_scan_active_unmapped);
>+ if (count >= SWAP_CLUSTER_MAX) {
>+ atomic_set(&zone->nr_scan_active_unmapped, 0);
>+ shrink_active_list(zone, &zone->active_unmapped_list,
>+ &zone->nr_active_unmapped, count, ps);
>+ }
>
>- atomic_add(ratio+1, &zone->nr_scan_active);
>- count = atomic_read(&zone->nr_scan_active);
>+ atomic_add(mapped_ratio+1, &zone->nr_scan_active_mapped);
>+ count = atomic_read(&zone->nr_scan_active_mapped);
> if (count >= SWAP_CLUSTER_MAX) {
>- atomic_set(&zone->nr_scan_active, 0);
>- shrink_active_list(zone, &zone->active_list, count, ps);
>+ atomic_set(&zone->nr_scan_active_mapped, 0);
>+ shrink_active_list(zone, &zone->active_mapped_list,
>+ &zone->nr_active_mapped, count, ps);
> }
>
> atomic_add(max_scan, &zone->nr_scan_inactive);
>
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Nick Piggin <piggin@cyberone.com.au>
To: linux-kernel <linux-kernel@vger.kernel.org>,
Linux Memory Management <linux-mm@kvack.org>
Subject: Re: [RFC][PATCH 4/4] vm-mapped-x-active-lists
Date: Tue, 09 Mar 2004 16:39:00 +1100 [thread overview]
Message-ID: <404D5874.2060108@cyberone.com.au> (raw)
In-Reply-To: <404D5784.9080004@cyberone.com.au>
Nick Piggin wrote:
>
>@@ -714,14 +737,27 @@ shrink_zone(struct zone *zone, int max_s
> * just to make sure that the kernel will slowly sift through the
> * active list.
> */
>- ratio = (unsigned long)SWAP_CLUSTER_MAX * zone->nr_active /
>- ((zone->nr_inactive | 1) * 2);
>+ nr_active = zone->nr_active_mapped + zone->nr_active_unmapped;
>+ ratio = (unsigned long)SWAP_CLUSTER_MAX * nr_active /
>+ (zone->nr_inactive * 2 + 1);
>+ mapped_ratio = (unsigned long long)ratio * nr_active;
>+ do_div(mapped_ratio, zone->nr_active_mapped+1);
>
Just for information, this is where you would balance mapped vs unmapped
pages: do_div(mapped_ratio, 16); /* mapped pages are worth 16 times
more */
>+
>+ ratio = ratio - mapped_ratio;
>+ atomic_add(ratio+1, &zone->nr_scan_active_unmapped);
>+ count = atomic_read(&zone->nr_scan_active_unmapped);
>+ if (count >= SWAP_CLUSTER_MAX) {
>+ atomic_set(&zone->nr_scan_active_unmapped, 0);
>+ shrink_active_list(zone, &zone->active_unmapped_list,
>+ &zone->nr_active_unmapped, count, ps);
>+ }
>
>- atomic_add(ratio+1, &zone->nr_scan_active);
>- count = atomic_read(&zone->nr_scan_active);
>+ atomic_add(mapped_ratio+1, &zone->nr_scan_active_mapped);
>+ count = atomic_read(&zone->nr_scan_active_mapped);
> if (count >= SWAP_CLUSTER_MAX) {
>- atomic_set(&zone->nr_scan_active, 0);
>- shrink_active_list(zone, &zone->active_list, count, ps);
>+ atomic_set(&zone->nr_scan_active_mapped, 0);
>+ shrink_active_list(zone, &zone->active_mapped_list,
>+ &zone->nr_active_mapped, count, ps);
> }
>
> atomic_add(max_scan, &zone->nr_scan_inactive);
>
>
>
--
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:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2004-03-09 5:40 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-09 5:32 [RFC][PATCH 0/4] VM split active lists Nick Piggin
2004-03-09 5:32 ` Nick Piggin
2004-03-09 5:33 ` [RFC][PATCH 1/4] vm-lrutopage-cleanup Nick Piggin
2004-03-09 5:33 ` [RFC][PATCH 2/4] vm-nofixed-active-list Nick Piggin
2004-03-09 5:34 ` [RFC][PATCH 3/4] vm-no-reclaim_mapped Nick Piggin
2004-03-09 5:35 ` [RFC][PATCH 4/4] vm-mapped-x-active-lists Nick Piggin
2004-03-09 5:39 ` Nick Piggin [this message]
2004-03-09 5:39 ` Nick Piggin
2004-03-09 5:47 ` Mike Fedyk
2004-03-09 5:47 ` Mike Fedyk
2004-03-09 6:06 ` Nick Piggin
2004-03-09 6:06 ` Nick Piggin
2004-03-09 7:02 ` William Lee Irwin III
2004-03-09 7:02 ` William Lee Irwin III
2004-03-09 7:23 ` Nick Piggin
2004-03-09 7:23 ` Nick Piggin
2004-03-09 7:37 ` William Lee Irwin III
2004-03-09 7:37 ` William Lee Irwin III
2004-03-09 9:24 ` William Lee Irwin III
2004-03-09 9:24 ` William Lee Irwin III
2004-03-09 15:26 ` Marc-Christian Petersen
2004-03-09 15:42 ` Nikita Danilov
2004-03-09 15:42 ` Nikita Danilov
2004-03-10 2:49 ` Nick Piggin
2004-03-10 2:49 ` Nick Piggin
2004-03-10 5:10 ` [RFC][PATCH 0/4] VM split active lists Nick Piggin
2004-03-10 5:10 ` Nick Piggin
2004-03-12 9:58 ` Hans Reiser
2004-03-12 9:58 ` Hans Reiser
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=404D5874.2060108@cyberone.com.au \
--to=piggin@cyberone.com.au \
--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.