Arun R Bharadwaj | 16 Sep 11:10

[RFC PATCH 1/1]: timers: Enabling timer migration to cpu0

The implentation details of this as follows:
A sysfs entry is created at /sys/devices/system/cpu/cpuX/timer_migration. By setting this to 1, timer
migration is enabled for that cpu.
An important thing to note here is cpu-pinned timers. Timers can be pinned to a particular cpu using the
function add_timer_on(). So, such timers should not be migrated.
Since the last 3 bits of the tvec_base is guaranteed to be 0, and since the last bit is being used to indicate
deferrable timers, I'm using the second last bit to indicate cpu-pinned timers.
The implementation of functions to manage the TBASE_PINNED_FLAG is similar to those which manage the TBASE_DEFERRABLE_FLAG.

Signed-off-by: Arun Bharadwaj <arun <at> linux.vnet.ibm.com>
---
Index: linux-2.6.26/drivers/base/cpu.c
===================================================================
--- linux-2.6.26.orig/drivers/base/cpu.c	2008-09-15 08:14:40.000000000 +0000
+++ linux-2.6.26/drivers/base/cpu.c	2008-09-15 09:34:52.000000000 +0000
@@ -13,6 +13,7 @@

 #include "base.h"

+DEFINE_PER_CPU(int, enable_timer_migration);
 struct sysdev_class cpu_sysdev_class = {
 	.name = "cpu",
 };
@@ -20,6 +21,21 @@

 static DEFINE_PER_CPU(struct sys_device *, cpu_sys_devices);

+#ifdef CONFIG_TIMER_MIGRATION
+static ssize_t timer_migration_show(struct sys_device *dev, char *buf)
+{
(Continue reading)


Gmane