lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 21 Oct 2009 10:28:22 -0700
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	discuss@...sWatts.org, lkml <linux-kernel@...r.kernel.org>
Cc:	Corey Minyard <minyard@....org>,
	openipmi-developer@...ts.sourceforge.net,
	Arjan van de Ven <arjan@...ux.intel.com>
Subject: [PATCH] ipmi: use round_jiffies on timers to reduce timer
 overhead/wakeups

From: Randy Dunlap <randy.dunlap@...cle.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@...cle.com>
Cc:	Corey Minyard <minyard@....org>
Cc:	openipmi-developer@...ts.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ