linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
To: Rik van Riel <riel@redhat.com>
Cc: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@osdl.org>,
	Christoph Lameter <christoph@lameter.com>,
	Wu Fengguang <wfg@mail.ustc.edu.cn>,
	Nick Piggin <npiggin@suse.de>, Marijn Meijles <marijn@bitpit.net>
Subject: Re: [PATCH 6/9] clockpro-clockpro.patch
Date: Tue, 24 Jan 2006 15:30:10 +0900	[thread overview]
Message-ID: <20060124063010.B85C77402D@sv1.valinux.co.jp> (raw)
In-Reply-To: <20060106090135.3525D74031@sv1.valinux.co.jp>

At Fri, 06 Jan 2006 18:01:35 +0900,
IWAMOTO Toshihiro wrote:
> 
> At Thu, 5 Jan 2006 08:32:19 -0500 (EST),
> Rik van Riel wrote:
> > 
> > On Thu, 5 Jan 2006, IWAMOTO Toshihiro wrote:
> 
> > > In my understanding of CLOCK-Pro, such lapping causes sudden increase
> > > in the distance between Hhot and Hcold.  As that distance is an
> > > important parameter of page aging/replacement decisions, I'm afraid
> > > that such lapping would result in incorrect page aging and bad
> > > performance.
> > 
> > Hcold only manipulates cold pages, Hhot only manipulates hot
> > pages and the test bit on cold pages.  Having one hand overtake
> > the other should not disturb things at all, since they both do
> > something different.
> 
> I don't think so.  Hhot turns unreferenced hot pages into cold ones,
> and those are freed if they aren't referenced before Hcold passes.
> So, the distance between those hands is a sort of "expiry timer" of
> such pages.
> The distance also affects aging of newly inserted pages.

I've added the following code to count lappings.
I also measured speeds of hands from pgrefill* and pgscan* in
/proc/vmstat.

While executing

	$ while true; do cksum zero; done

, where zero is a 1100MB file and the amount of the system RAM is 1GB,
Hcold was almost twice faster than Hhot in ZONE_DMA32 (the system was
x86_64), and Hcold was steadily overtaking Hhot.
(Interestingly, in ZONE_DMA, Hhot was faster than Hcold.  I think this
can be ignored for now.)

I thought this situation means that page access frequencies cannot be
correctly compared and leads to suboptimal performance, but I couldn't
prove that.  However, I've managed to create an example workload where
clockpro performs worse.  I'm not sure if the example is related to
this hand problem.  I'll describe it in the next mail.


diff -urp linux-2.6.15-rc5-clockpro-orig/mm/clockpro.c linux-2.6.15-rc5-clockpro-20051231/mm/clockpro.c
--- linux-2.6.15-rc5-clockpro-orig/mm/clockpro.c	2006-01-24 15:05:01.000000000 +0900
+++ linux-2.6.15-rc5-clockpro-20051231/mm/clockpro.c	2006-01-13 16:36:16.000000000 +0900
@@ -119,8 +119,13 @@ static void swap_lists(struct zone *zone
 static inline
 void __select_list_hand(struct zone *zone, struct list_head *list)
 {
-	if (list_empty(list))
+	if (list_empty(list)) {
 		swap_lists(zone);
+		if (list == &zone->list_hand[hand_hot])
+			zone->handswapcnt++;
+		else
+			zone->handswapcnt--;
+	}
 }
 
 /*
@@ -589,6 +594,7 @@ static int stats_show(struct seq_file *m
 		seq_printf(m, "  zone->nr_cold: %lu\n", zone->nr_cold);
 		seq_printf(m, "  zone->nr_cold_target: %lu\n", zone->nr_cold_target);
 		seq_printf(m, "  zone->nr_nonresident_scale: %lu\n", zone->nr_nonresident_scale);
+		seq_printf(m, "  zone->handswapcnt: %ld\n", zone->handswapcnt);
 		seq_printf(m, "  zone->present_pages: %lu\n", zone->present_pages);
 		seq_printf(m, "  zone->free_pages: %lu\n", zone->free_pages);
 		seq_printf(m, "  zone->pages_min: %lu\n", zone->pages_min);
diff -urp linux-2.6.15-rc5-clockpro-orig/include/linux/mmzone.h linux-2.6.15-rc5-clockpro-20051231/include/linux/mmzone.h
--- linux-2.6.15-rc5-clockpro-orig/include/linux/mmzone.h	2006-01-24 15:05:01.000000000 +0900
+++ linux-2.6.15-rc5-clockpro-20051231/include/linux/mmzone.h	2006-01-13 16:33:32.000000000 +0900
@@ -146,6 +146,7 @@ struct zone {
 	unsigned long		nr_cold;
 	unsigned long 		nr_cold_target;
 	unsigned long		nr_nonresident_scale;
+	long			handswapcnt;
 
 	unsigned long		pages_scanned;	   /* since last reclaim */
 	int			all_unreclaimable; /* All pages pinned */
diff -urp linux-2.6.15-rc5-clockpro-orig/include/linux/page-flags.h linux-2.6.15-rc5-clockpro-20051231/include/linux/page-flags.h
--- linux-2.6.15-rc5-clockpro-orig/include/linux/page-flags.h	2006-01-24 15:05:01.000000000 +0900
+++ linux-2.6.15-rc5-clockpro-20051231/include/linux/page-flags.h	2006-01-16 18:17:19.000000000 +0900
@@ -155,7 +155,7 @@ extern void __mod_page_state(unsigned lo
 #define mod_page_state_zone(zone, member, delta)				\
 	do {									\
 		unsigned offset;						\
-		if (is_highmem(zone))						\
+		if (is_highmem(zone) || zone == zone->zone_pgdat->node_zones + ZONE_DMA32)						\
 			offset = offsetof(struct page_state, member##_high);	\
 		else if (is_normal(zone))					\
 			offset = offsetof(struct page_state, member##_normal);	\


--
IWAMOTO Toshihiro

--
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>

  reply	other threads:[~2006-01-24  6:30 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-30 22:40 [PATCH] vm: page-replace and clockpro Peter Zijlstra
2005-12-30 22:40 ` [PATCH 01/14] page-replace-single-batch-insert.patch Peter Zijlstra
2005-12-31  7:03   ` Marcelo Tosatti
2005-12-31  9:43     ` Peter Zijlstra
2005-12-31 14:44     ` Rik van Riel
2005-12-31 22:19       ` Marcelo Tosatti
2005-12-30 22:40 ` [PATCH 02/14] page-replace-try_pageout.patch Peter Zijlstra
2005-12-30 22:40 ` [PATCH 03/14] page-replace-remove-sc-from-refill.patch Peter Zijlstra
2005-12-30 22:40 ` [PATCH 04/14] page-replace-activate_page.patch Peter Zijlstra
2005-12-30 22:41 ` [PATCH 05/14] page-replace-remove-loop.patch Peter Zijlstra
2005-12-30 22:41 ` [PATCH 06/14] page-replace-move-macros.patch Peter Zijlstra
2005-12-30 22:41 ` [PATCH 07/14] page-replace-move-isolate_lru_pages.patch Peter Zijlstra
2005-12-30 22:41 ` [PATCH 08/14] page-replace-candidates.patch Peter Zijlstra
2005-12-30 22:41 ` [PATCH 09/14] page-replace-reinsert.patch Peter Zijlstra
2005-12-30 22:41 ` [PATCH 10/14] page-replace-remove-mm_inline.patch Peter Zijlstra
2005-12-30 22:42 ` [PATCH 11/14] page-replace-move-refill.patch Peter Zijlstra
2005-12-30 22:42 ` [PATCH 12/14] page-replace-rotate.patch Peter Zijlstra
2005-12-30 22:42 ` [PATCH 13/14] page-replace-init.patch Peter Zijlstra
2005-12-30 22:42 ` [PATCH 14/14] page-replace-kswapd-incmin.patch Peter Zijlstra
2005-12-31  1:15   ` Marcelo Tosatti
2005-12-31  9:40     ` Peter Zijlstra
2005-12-30 22:42 ` [PATCH 1/9] clockpro-nonresident.patch Peter Zijlstra
2005-12-31  1:13   ` Marcelo Tosatti
2005-12-31  9:54     ` Peter Zijlstra
2005-12-31 14:53       ` Rik van Riel
2005-12-31 22:20         ` Marcelo Tosatti
2005-12-30 22:42 ` [PATCH 2/9] clockpro-nonresident-del.patch Peter Zijlstra
2005-12-30 22:43 ` [PATCH 3/9] clockpro-PG_test.patch Peter Zijlstra
2005-12-30 22:43 ` [PATCH 4/9] clockpro-use-once.patch Peter Zijlstra
2005-12-30 22:43 ` [PATCH 5/9] clockpro-ignore_token.patch Peter Zijlstra
2005-12-30 22:43 ` [PATCH 6/9] clockpro-clockpro.patch Peter Zijlstra
2005-12-31  0:24   ` Marcelo Tosatti
2005-12-31  1:22     ` Rik van Riel
2005-12-31  3:27       ` Marcelo Tosatti
2005-12-31  5:24         ` Rik van Riel
2005-12-31 10:57           ` Peter Zijlstra
2005-12-31 10:48     ` Peter Zijlstra
2005-12-31 22:12       ` Marcelo Tosatti
2006-01-03 19:30         ` Christoph Lameter
2005-12-31 11:29     ` Peter Zijlstra
2006-01-05  9:47       ` IWAMOTO Toshihiro
2006-01-05 13:32         ` Rik van Riel
2006-01-06  9:01           ` IWAMOTO Toshihiro
2006-01-24  6:30             ` IWAMOTO Toshihiro [this message]
2006-01-24  7:25               ` IWAMOTO Toshihiro
2006-01-25  8:00                 ` Peter Zijlstra
2006-02-03  9:25                 ` Peter Zijlstra
2006-02-06  9:30                   ` IWAMOTO Toshihiro
2006-02-06 10:07                     ` Peter Zijlstra
2006-02-08 10:05                   ` IWAMOTO Toshihiro
2006-02-08 20:00                     ` Peter Zijlstra
2006-02-09  6:57                       ` Peter Zijlstra
2006-02-09  7:22                       ` IWAMOTO Toshihiro
2006-02-09 10:07                         ` IWAMOTO Toshihiro
2006-02-09 15:23                       ` Rik van Riel
2006-02-08  9:53                 ` IWAMOTO Toshihiro
2005-12-31 22:40   ` Marcelo Tosatti
2006-01-01 10:37     ` Peter Zijlstra
2006-01-03 12:21       ` Marcelo Tosatti
2006-02-14  7:29   ` IWAMOTO Toshihiro
2006-02-15  6:35     ` Peter Zijlstra
2006-02-16  6:25       ` IWAMOTO Toshihiro
2005-12-30 22:43 ` [PATCH 7/9] clockpro-remove-old.patch Peter Zijlstra
2005-12-30 22:43 ` [PATCH 8/9] clockpro-rename_PG_active.patch Peter Zijlstra
2005-12-30 22:44 ` [PATCH 9/9] clockpro-clockpro-stats.patch Peter Zijlstra
2005-12-31 18:59 ` [PATCH 10/9] clockpro-document.patch Peter Zijlstra

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=20060124063010.B85C77402D@sv1.valinux.co.jp \
    --to=iwamoto@valinux.co.jp \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@osdl.org \
    --cc=christoph@lameter.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=marijn@bitpit.net \
    --cc=npiggin@suse.de \
    --cc=riel@redhat.com \
    --cc=wfg@mail.ustc.edu.cn \
    /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