mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ZVC: Increase threshold for larger processor configurationss
Date: Thu, 29 Jun 2006 23:15:55 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606292314580.31091@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0606291116500.27926@schroedinger.engr.sgi.com>

On Thu, 29 Jun 2006, Christoph Lameter wrote:

> > Did you consider my earlier suggestion about these counters?  That, over the
> > short-term, they tend to count in only one direction?  So we can do
> Uhh... We are overcompensating right? Pretty funky idea that is new to me 
> and that would require some thought.
> 
> This would basically increase the stepping by 50% if we are only going in 
> one direction.

A patch that does this:


ZVC: overcompensate while incrementing ZVC counters

Overcompensate by a balance factor when incrementing or decrementing
ZVC counters anticipating continual increase in the same direction.

Note that I have not been able to see any effect off this approach on
an 8p system where I tested this.
I probably will have a chance to test it on larger systems (160p) tomorrow.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.17-mm4/mm/vmstat.c
===================================================================
--- linux-2.6.17-mm4.orig/mm/vmstat.c	2006-06-29 13:35:16.959161608 -0700
+++ linux-2.6.17-mm4/mm/vmstat.c	2006-06-29 13:54:46.361438715 -0700
@@ -167,6 +167,9 @@ EXPORT_SYMBOL(mod_zone_page_state);
  * in between and therefore the atomicity vs. interrupt cannot be exploited
  * in a useful way here.
  */
+
+#define balance_factor(x) (x->stat_threshold / 2)
+
 static void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
 {
 	struct per_cpu_pageset *pcp = zone_pcp(zone, smp_processor_id());
@@ -175,8 +178,8 @@ static void __inc_zone_state(struct zone
 	(*p)++;
 
 	if (unlikely(*p > pcp->stat_threshold)) {
-		zone_page_state_add(*p, zone, item);
-		*p = 0;
+		zone_page_state_add(*p + balance_factor(pcp), zone, item);
+		*p = -balance_factor(pcp);
 	}
 }
 
@@ -195,8 +198,8 @@ void __dec_zone_page_state(struct page *
 	(*p)--;
 
 	if (unlikely(*p < -pcp->stat_threshold)) {
-		zone_page_state_add(*p, zone, item);
-		*p = 0;
+		zone_page_state_add(*p - balance_factor(pcp), zone, item);
+		*p = balance_factor(pcp);
 	}
 }
 EXPORT_SYMBOL(__dec_zone_page_state);

  parent reply	other threads:[~2006-06-30  6:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-28 17:41 Christoph Lameter
2006-06-28 22:49 ` Andrew Morton
2006-06-29 18:22   ` Christoph Lameter
2006-06-29 18:57     ` Andrew Morton
2006-06-30 17:15       ` Christoph Lameter
2006-06-30  6:14     ` Christoph Lameter
2006-06-30  6:15     ` Christoph Lameter [this message]
2006-06-30  6:31       ` Andrew Morton
2006-06-30  7:17         ` 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=Pine.LNX.4.64.0606292314580.31091@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®