Skip to contentSkip to conversation

Export deferrable timer through workqueue and use it in ondemand governor

PATCH In review Venkatesh Pallipadi 2 participants 4 messages Mar 21, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Export deferrable timer through workqueue and use it in ondemand governor

Add a new deferrable delayed work init. This can be used to schedule work that are 'unimportant' when CPU is idle and can be called later, when CPU eventually comes out of idle.

Use this init in cpufreq ondemand governor.

drivers/cpufreq/cpufreq_ondemand.c +1 -1
Index: new/drivers/cpufreq/cpufreq_ondemand.c
===================================================================
@@ -470,7 +470,7 @@
 	dbs_info->enable = 1;
 	ondemand_powersave_bias_init();
 	dbs_info->sample_type = DBS_NORMAL_SAMPLE;
-	INIT_DELAYED_WORK(&dbs_info->work, do_dbs_timer);
+	INIT_DELAYED_WORK_DEF(&dbs_info->work, do_dbs_timer);
 	queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work,
 	                      delay);
 }
include/linux/workqueue.h +6 -0
Index: new/include/linux/workqueue.h
===================================================================
@@ -115,6 +115,12 @@
 		init_timer(&(_work)->timer);			\
 	} while (0)
 
+#define INIT_DELAYED_WORK_DEF(_work, _func)			\
+	do {							\
+		INIT_WORK(&(_work)->work, (_func));		\
+		init_timer_deferrable(&(_work)->timer);		\
+	} while (0)
+
 #define INIT_DELAYED_WORK_NAR(_work, _func)			\
 	do {							\
 		INIT_WORK_NAR(&(_work)->work, (_func));		\
#1 lore raw
Quoted 9 lines · Venkatesh Pallipadi

Add a new deferrable delayed work init. This can be used to schedule work that are 'unimportant' when CPU is idle and can be called later, when CPU eventually comes out of idle.

Use this init in cpufreq ondemand governor.

drivers/cpufreq/cpufreq_ondemand.c: In function 'dbs_timer_init':
drivers/cpufreq/cpufreq_ondemand.c:473: error: implicit declaration of function 'init_timer_deferrable'

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#2 lore raw
Quoted 7 lines · Dave Jones
Quoted 6 lines · Venkatesh Pallipadi

Add a new deferrable delayed work init. This can be used to schedule work that are 'unimportant' when CPU is idle and can be called later, when CPU eventually comes out of idle.

Quoted 8 lines
Quoted 3 lines

Use this init in cpufreq ondemand governor.

drivers/cpufreq/cpufreq_ondemand.c: In function 'dbs_timer_init':
drivers/cpufreq/cpufreq_ondemand.c:473: error: implicit declaration of function 'init_timer_deferrable'

init_timer_deferrable is defined in
[PATCH 1/2] Add support for deferrable timers
http://www.ussg.iu.edu/hypermail/linux/kernel/0703.2/2064.html

Do you get this error after that patch?

Thanks,
~Venki