public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Lord <lkml@rtr.ca>
To: Arjan van de Ven <arjan@infradead.org>
Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	abelay@novell.com, lenb@kernel.org, rjw@sisk.pl,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: + restore-missing-sysfs-max_cstate-attr.patch added to -mm tree
Date: Fri, 30 Nov 2007 22:44:25 -0500	[thread overview]
Message-ID: <4750D899.4020905@rtr.ca> (raw)
In-Reply-To: <4750D585.1030200@rtr.ca>

Arjan van de Ven wrote:
> On Fri, 30 Nov 2007 22:31:17 -0500
> Mark Lord <lkml@rtr.ca> wrote:
> 
>> Arjan van de Ven wrote:
>>> On Fri, 30 Nov 2007 22:14:08 -0500
>>> Mark Lord <lkml@rtr.ca> wrote:
>>>
>>>>> in -mm there is.. the QoS stuff allows you to set maximum
>>>>> tolerable
>>>> ..
>>>>
>>>> That's encouraging, I think, but not for 2.6.24.
>>>>
>>>>> latency. If your app cant take any latency, you should set
>>>>> those... and the side effect is that the kernel will not do
>>>>> long-latency C-states or P-state transitions..
>>>> ..
>>>>
>>>> I don't mind the cpufreq changing (actually, I want it to drop in
>>>> cpugfreq to save power and keep the fan off), but the C-states just
>>>> kill this app.
>>>>
>>>> The app is VMware.  I force the max_state=1 when launching,
>>> ah but then its' even easier... and can be done in 2.6.24 already.
>>> VMWare after all has a kernel module, and the latency stuff is in
>>> 2.6.23 and 2.6.24 available inside the kernel already.
>> ..
>>
>> Oh, I'm perfectly happy to write my own kernel module if that's what
> 
> all you need to do in your kernel module is call
> 
> add_latency_constraint("mark_wants_his_mouse", 5);

Okay, and how to change it back again?  (thanks)

Then why not have a sysfs entry for scripts to write to
to trigger the exact same end result?  :)

>> Speaking of which.. what's with powertop on 2.6.24 ???
>> It's gone from 100-200 wakeups/sec to 20000 wakeups/sec !!!!!!!
> 
> ho hum.. Lenovo T61?
> I have some reports that that happens once in a while (but it's not
> limited to .24 and it's also real, it's not a powertop bug but it
> actually is waking up that much)..
..

No, it's my hefty Dell Inspiron 9400.

And I just figured out the powertop:  it needed the kernel timers
patch from the powertop site that was originally for 2.6.21.. 

Any chance of somebody actually pushing that patch upstream some year ??
Patch reproduced here for interest's sake only.
Hey, look who's on the Signed-off list for it, *Arjan* !

* * *

>From e6f2ff1e4763212f1dcc945db76fb744b951ac53 Mon Sep 17 00:00:00 2001
From: Josh Triplett <josh@freedesktop.org>
Date: Sun, 13 May 2007 15:21:39 -0700
Subject: [PATCH] Lengthen and align background timers to decrease wakeups

This patch changes a few background timers in the Linux kernel to
1) be aligned to full seconds so that multiple timers get handled in one
   processor wakeup
2) have longer timeouts for those timers that can use such longer timeouts

Some of these are a bit crude, but it's effective.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
[Josh: Updates for 2.6.22-rc1]
Signed-off-by: Josh Triplett <josh@kernel.org>
---
 kernel/time/clocksource.c |   10 ++++++++--
 mm/page-writeback.c       |    8 ++++----
 mm/slab.c                 |    6 +++---
 net/core/neighbour.c      |    4 ++--
 4 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 3db5c3c..77308c4 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -79,11 +79,17 @@ static int watchdog_resumed;
 /*
  * Interval: 0.5sec Threshold: 0.0625s
  */
-#define WATCHDOG_INTERVAL (HZ >> 1)
+#define WATCHDOG_INTERVAL (HZ*10)
 #define WATCHDOG_THRESHOLD (NSEC_PER_SEC >> 4)
 
+static int secondtime;
+
 static void clocksource_ratewd(struct clocksource *cs, int64_t delta)
 {
+	if (!secondtime) {
+		secondtime = 1;
+		return;
+	};
 	if (delta > -WATCHDOG_THRESHOLD && delta < WATCHDOG_THRESHOLD)
 		return;
 
@@ -145,7 +151,7 @@ static void clocksource_watchdog(unsigned long data)
 
 	if (!list_empty(&watchdog_list)) {
 		__mod_timer(&watchdog_timer,
-			    watchdog_timer.expires + WATCHDOG_INTERVAL);
+			    round_jiffies(watchdog_timer.expires + WATCHDOG_INTERVAL));
 	}
 	spin_unlock(&watchdog_lock);
 }
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index eec1481..26318e5 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -77,7 +77,7 @@ int vm_dirty_ratio = 10;
 /*
  * The interval between `kupdate'-style writebacks, in jiffies
  */
-int dirty_writeback_interval = 5 * HZ;
+int dirty_writeback_interval = 15 * HZ;
 
 /*
  * The longest number of jiffies for which data is allowed to remain dirty
@@ -450,7 +450,7 @@ static void wb_kupdate(unsigned long arg)
 
 	oldest_jif = jiffies - dirty_expire_interval;
 	start_jif = jiffies;
-	next_jif = start_jif + dirty_writeback_interval;
+	next_jif = round_jiffies(start_jif + dirty_writeback_interval);
 	nr_to_write = global_page_state(NR_FILE_DIRTY) +
 			global_page_state(NR_UNSTABLE_NFS) +
 			(inodes_stat.nr_inodes - inodes_stat.nr_unused);
@@ -467,7 +467,7 @@ static void wb_kupdate(unsigned long arg)
 		nr_to_write -= MAX_WRITEBACK_PAGES - wbc.nr_to_write;
 	}
 	if (time_before(next_jif, jiffies + HZ))
-		next_jif = jiffies + HZ;
+		next_jif = round_jiffies(jiffies + HZ);
 	if (dirty_writeback_interval)
 		mod_timer(&wb_timer, next_jif);
 }
@@ -491,7 +491,7 @@ int dirty_writeback_centisecs_handler(ctl_table *table, int write,
 static void wb_timer_fn(unsigned long unused)
 {
 	if (pdflush_operation(wb_kupdate, 0) < 0)
-		mod_timer(&wb_timer, jiffies + HZ); /* delay 1 second */
+		mod_timer(&wb_timer, round_jiffies(jiffies + HZ)); /* delay 1 second */
 }
 
 static void laptop_flush(unsigned long unused)
diff --git a/mm/slab.c b/mm/slab.c
index 944b205..6003eef 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -467,8 +467,8 @@ struct kmem_cache {
  * OTOH the cpuarrays can contain lots of objects,
  * which could lock up otherwise freeable slabs.
  */
-#define REAPTIMEOUT_CPUC	(2*HZ)
-#define REAPTIMEOUT_LIST3	(4*HZ)
+#define REAPTIMEOUT_CPUC	(12*HZ)
+#define REAPTIMEOUT_LIST3	(20*HZ)
 
 #if STATS
 #define	STATS_INC_ACTIVE(x)	((x)->num_active++)
@@ -959,7 +959,7 @@ static void __devinit start_cpu_timer(int cpu)
 		init_reap_node(cpu);
 		INIT_DELAYED_WORK(reap_work, cache_reap);
 		schedule_delayed_work_on(cpu, reap_work,
-					__round_jiffies_relative(HZ, cpu));
+					__round_jiffies_relative(HZ*4, cpu));
 	}
 }
 
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 6f3bb73..e6aaa9c 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -696,10 +696,10 @@ next_elt:
 	if (!expire)
 		expire = 1;
 
-	if (expire>HZ)
+	if (expire>4*HZ)
 		mod_timer(&tbl->gc_timer, round_jiffies(now + expire));
 	else
-		mod_timer(&tbl->gc_timer, now + expire);
+		mod_timer(&tbl->gc_timer, round_jiffies(now + 4*HZ));
 
 	write_unlock(&tbl->lock);
 }
-- 
1.5.2-rc2.GIT

  reply	other threads:[~2007-12-01  3:44 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200711302153.lAULrZ7n026255@imap1.linux-foundation.org>
     [not found] ` <924EFEDD5F540B4284297C4DC59F3DEE2FAE6A@orsmsx423.amr.corp.intel.com>
2007-11-30 22:20   ` + restore-missing-sysfs-max_cstate-attr.patch added to -mm tree Andrew Morton
2007-11-30 22:37     ` Pallipadi, Venkatesh
2007-12-01  2:52       ` Mark Lord
2007-12-01  3:02         ` Arjan van de Ven
2007-12-01  3:14           ` Mark Lord
2007-12-01  3:18             ` Arjan van de Ven
2007-12-01  3:31               ` Mark Lord
2007-12-01  3:44                 ` Mark Lord [this message]
2007-12-01  3:48                   ` Mark Lord
2007-12-01  4:02                   ` Mark Lord
2007-12-01  4:31                     ` Mark Lord
2007-12-01 23:43                   ` 20000+ wake-ups/second in 2.6.24. Bug? Mark Lord
2007-12-01 23:46                     ` Arjan van de Ven
2007-12-01 23:55                       ` Mark Lord
2007-12-02  0:13                         ` Arjan van de Ven
2007-12-02  1:10                           ` Andres Freund
2007-12-02  0:20                         ` Rafael J. Wysocki
2008-02-04 17:29                           ` Mark Lord
2008-02-04 17:50                             ` Arjan van de Ven
2008-02-04 19:17                               ` Mark Lord
2007-12-02 14:41                     ` Adrian Bunk
2007-12-02 14:59                       ` Mark Lord
2007-12-02 15:12                         ` Adrian Bunk
2007-12-02 15:45                           ` Mark Lord
2007-12-02 15:45                           ` Mark Lord
2007-12-02 15:49                           ` Mark Lord
2008-01-02 23:41                 ` + restore-missing-sysfs-max_cstate-attr.patch added to -mm tree Mark Lord
2008-01-03  0:06                   ` Pallipadi, Venkatesh
2008-01-03  0:51                     ` Andrew Morton
2008-01-03  1:12                       ` Pallipadi, Venkatesh
2008-01-03  4:25                         ` Mark Lord
2008-01-03  4:18                     ` Mark Lord
2008-01-04  2:16                       ` Venki Pallipadi
2008-01-04  3:16                         ` Mark Lord
2008-01-04 21:52                           ` Mark Lord
2008-01-04 21:59                             ` Pallipadi, Venkatesh
2008-01-05 16:27                               ` Mark Lord
2008-01-06 21:34                         ` Mark Lord
2008-01-07  7:18                           ` Andrew Morton
2008-01-07 14:07                             ` Arjan van de Ven
2008-01-07 15:07                               ` Mark Lord
2008-01-07 14:18                             ` Pallipadi, Venkatesh
2008-01-07 15:06                             ` Mark Lord
2008-01-07 19:12                               ` Len Brown
2008-01-07 21:33                                 ` Mark Lord
2008-01-07 22:43                                   ` Len Brown
2007-12-01 10:17             ` Andrew Morton
2007-12-01 16:30               ` Arjan van de Ven
2007-12-05 11:17       ` Pavel Machek
2007-12-07 21:38         ` Pallipadi, Venkatesh

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=4750D899.4020905@rtr.ca \
    --to=lkml@rtr.ca \
    --cc=abelay@novell.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=venkatesh.pallipadi@intel.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