提交 28287033 编写于 作者: V Venki Pallipadi 提交者: Linus Torvalds

Add a new deferrable delayed work init

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.
Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6e453a67
...@@ -470,7 +470,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) ...@@ -470,7 +470,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
dbs_info->enable = 1; dbs_info->enable = 1;
ondemand_powersave_bias_init(); ondemand_powersave_bias_init();
dbs_info->sample_type = DBS_NORMAL_SAMPLE; dbs_info->sample_type = DBS_NORMAL_SAMPLE;
INIT_DELAYED_WORK(&dbs_info->work, do_dbs_timer); INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work, queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work,
delay); delay);
} }
......
...@@ -121,6 +121,12 @@ struct execute_work { ...@@ -121,6 +121,12 @@ struct execute_work {
init_timer(&(_work)->timer); \ init_timer(&(_work)->timer); \
} while (0) } while (0)
#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \
do { \
INIT_WORK(&(_work)->work, (_func)); \
init_timer_deferrable(&(_work)->timer); \
} while (0)
/** /**
* work_pending - Find out whether a work item is currently pending * work_pending - Find out whether a work item is currently pending
* @work: The work item in question * @work: The work item in question
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册