From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
To: Con Kolivas <kernel@kolivas.org>
Cc: ck@vds.kolivas.org, tony@atomide.com,
tuukka.tikkanen@elektrobit.com, akpm@osdl.org,
johnstul@us.ibm.com, linux-kernel@vger.kernel.org, ak@muc.de,
schwidefsky@de.ibm.com, george@mvista.com
Subject: Re: [ck] [PATCH] dynamic-tick patch modified for SMP
Date: Sat, 13 Aug 2005 17:07:17 +0530 [thread overview]
Message-ID: <20050813113717.GB4550@in.ibm.com> (raw)
In-Reply-To: <200508131651.08809.kernel@kolivas.org>
On Sat, Aug 13, 2005 at 04:51:07PM +1000, Con Kolivas wrote:
> I'm sorry to say this doesn't appear to skip any ticks on my single P4 with
> SMP/SMT enabled.
Con,
I had enabled skipping ticks only in default_idle routine. So if
you have a different idle route (which I suspect is the case), it will not
skip ticks (since dyn_tick_reprogram_timer will not be called).
Can you try this patch?
---
linux-2.6.13-rc6-root/arch/i386/kernel/process.c | 7 ++++---
linux-2.6.13-rc6-root/kernel/dyn-tick.c | 8 ++++++--
2 files changed, 10 insertions(+), 5 deletions(-)
diff -puN kernel/dyn-tick.c~dynamic-tick-smp-fix kernel/dyn-tick.c
--- linux-2.6.13-rc6/kernel/dyn-tick.c~dynamic-tick-smp-fix 2005-08-13 15:53:56.000000000 +0530
+++ linux-2.6.13-rc6-root/kernel/dyn-tick.c 2005-08-13 15:56:12.000000000 +0530
@@ -37,16 +37,18 @@ spinlock_t dyn_tick_lock;
/*
* Arch independent code needed to reprogram next timer interrupt.
- * Gets called with IRQs disabled from cpu_idle() before entering idle loop.
+ * Gets called from cpu_idle() before entering idle loop.
*/
unsigned long dyn_tick_reprogram_timer(void)
{
int cpu = smp_processor_id();
- unsigned long delta;
+ unsigned long delta, flags;
if (!DYN_TICK_IS_SET(DYN_TICK_ENABLED))
return 0;
+ local_irq_save(flags);
+
if (rcu_pending(cpu) || local_softirq_pending())
return 0;
@@ -76,6 +78,8 @@ unsigned long dyn_tick_reprogram_timer(v
write_sequnlock(&xtime_lock);
+ local_irq_restore(flags);
+
return delta;
}
diff -puN arch/i386/kernel/process.c~dynamic-tick-smp-fix arch/i386/kernel/process.c
--- linux-2.6.13-rc6/arch/i386/kernel/process.c~dynamic-tick-smp-fix 2005-08-13 15:53:56.000000000 +0530
+++ linux-2.6.13-rc6-root/arch/i386/kernel/process.c 2005-08-13 15:55:20.000000000 +0530
@@ -104,10 +104,9 @@ void default_idle(void)
{
if (!hlt_counter && boot_cpu_data.hlt_works_ok) {
local_irq_disable();
- if (!need_resched()) {
- dyn_tick_reprogram_timer();
+ if (!need_resched())
safe_halt();
- } else
+ else
local_irq_enable();
} else {
cpu_relax();
@@ -202,6 +201,8 @@ void cpu_idle(void)
if (cpu_is_offline(cpu))
play_dead();
+ dyn_tick_reprogram_timer();
+
__get_cpu_var(irq_stat).idle_timestamp = jiffies;
idle();
}
_
I have tested this patch on my Laptop (P4) that HZ goes down to ~25 with
dyn-ticks enabled (but Power consumption goes _up_ as Ted had noted earlier
- I need to try some of the ACPI patches that were pointed out in the thread).
--
Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017
next prev parent reply other threads:[~2005-08-13 11:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-12 20:19 Srivatsa Vaddagiri
2005-08-13 1:35 ` [ck] " Con Kolivas
2005-08-13 6:51 ` Con Kolivas
2005-08-13 11:37 ` Srivatsa Vaddagiri [this message]
2005-08-13 14:53 ` Con Kolivas
2005-08-13 16:46 ` Srivatsa Vaddagiri
2005-08-14 0:18 ` Con Kolivas
2005-08-14 4:15 ` Kyle Moffett
2005-08-15 15:47 ` Srivatsa Vaddagiri
2005-08-15 16:39 ` john stultz
2005-08-16 2:11 ` Srivatsa Vaddagiri
2005-08-15 15:35 ` Srivatsa Vaddagiri
2005-08-15 16:30 ` Con Kolivas
2005-08-16 13:19 ` Srivatsa Vaddagiri
2005-08-16 13:23 ` Con Kolivas
2005-08-17 7:53 ` Tony Lindgren
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=20050813113717.GB4550@in.ibm.com \
--to=vatsa@in.ibm.com \
--cc=ak@muc.de \
--cc=akpm@osdl.org \
--cc=ck@vds.kolivas.org \
--cc=george@mvista.com \
--cc=johnstul@us.ibm.com \
--cc=kernel@kolivas.org \
--cc=linux-kernel@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=tony@atomide.com \
--cc=tuukka.tikkanen@elektrobit.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
Powered by JetHome