public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipmi: use round_jiffies on timers to reduce timer overhead/wakeups
@ 2009-10-21 17:28 Randy Dunlap
  2009-10-21 18:42 ` Arjan van de Ven
  0 siblings, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2009-10-21 17:28 UTC (permalink / raw)
  To: discuss, lkml; +Cc: Corey Minyard, openipmi-developer, Arjan van de Ven

From: Randy Dunlap <randy.dunlap@oracle.com>

Use a round_jiffies() variant to reduce overhead of timer
wakeups.  This causes the ipmi timers to occur at the same
time as other timers (per CPU).

Typical powertop for /ipmi/ (2.6.31, before patch):
  11.4% (247.4)            kipmi0 : __mod_timer (process_timeout) 
   0.6% ( 13.1)       <interrupt> : ipmi_si 
   0.5% ( 10.0)     <kernel core> : __mod_timer (ipmi_timeout) 

powertop for /ipmi/, 2.6.31, after patch:
  10.8% (247.6)            kipmi0 : __mod_timer (process_timeout) 
   0.3% (  6.9)       <interrupt> : ipmi_si 
   0.0% (  1.0)     <kernel core> : __mod_timer (ipmi_timeout)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc:	Corey Minyard <minyard@acm.org>
Cc:	openipmi-developer@lists.sourceforge.net
---
 drivers/char/ipmi/ipmi_msghandler.c |    7 +++++--
 drivers/char/ipmi/ipmi_si_intf.c    |    3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

--- lnx-2632-rc5.orig/drivers/char/ipmi/ipmi_msghandler.c
+++ lnx-2632-rc5/drivers/char/ipmi/ipmi_msghandler.c
@@ -39,6 +39,7 @@
 #include <linux/spinlock.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
+#include <linux/timer.h>
 #include <linux/ipmi.h>
 #include <linux/ipmi_smi.h>
 #include <linux/notifier.h>
@@ -4057,7 +4058,8 @@ static void ipmi_timeout(unsigned long d
 
 	ipmi_timeout_handler(IPMI_TIMEOUT_TIME);
 
-	mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
+	mod_timer(&ipmi_timer,
+		round_jiffies_up(jiffies + IPMI_TIMEOUT_JIFFIES));
 }
 
 
@@ -4424,7 +4426,8 @@ static int ipmi_init_msghandler(void)
 #endif /* CONFIG_PROC_FS */
 
 	setup_timer(&ipmi_timer, ipmi_timeout, 0);
-	mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
+	mod_timer(&ipmi_timer,
+		round_jiffies_up(jiffies + IPMI_TIMEOUT_JIFFIES));
 
 	atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
 
--- lnx-2632-rc5.orig/drivers/char/ipmi/ipmi_si_intf.c
+++ lnx-2632-rc5/drivers/char/ipmi/ipmi_si_intf.c
@@ -1068,7 +1068,8 @@ static int smi_start_processing(void    
 	/* Set up the timer that drives the interface. */
 	setup_timer(&new_smi->si_timer, smi_timeout, (long)new_smi);
 	new_smi->last_timeout_jiffies = jiffies;
-	mod_timer(&new_smi->si_timer, jiffies + SI_TIMEOUT_JIFFIES);
+	mod_timer(&new_smi->si_timer,
+		round_jiffies_up(jiffies + SI_TIMEOUT_JIFFIES));
 
 	/*
 	 * Check if the user forcefully enabled the daemon.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-10-22 22:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-21 17:28 [PATCH] ipmi: use round_jiffies on timers to reduce timer overhead/wakeups Randy Dunlap
2009-10-21 18:42 ` Arjan van de Ven
2009-10-21 18:49   ` [Discuss] " Kok, Auke
2009-10-21 20:03     ` Randy Dunlap
2009-10-21 20:22       ` Corey Minyard
2009-10-21 20:57         ` Arjan van de Ven
2009-10-22  2:50           ` Matt Domsch
2009-10-22 16:45             ` Corey Minyard
2009-10-22 19:12             ` [Openipmi-developer] [Discuss] [PATCH] " Bela Lubkin
2009-10-22 20:02               ` Corey Minyard
2009-10-22 22:16                 ` Bela Lubkin
2009-10-21 23:46         ` Bela Lubkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox