History

workqueue: remove redundant function invocation

timer_stats_timer_set_start_info is invoked twice, additionally, the invocation of this function can be moved to where it is only called when a delay is really required.

Andrew Liu committed 18 years ago

Commit 8a3e77c1 parent 55e462b1 file · +2 −4Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+2−4
@@ -195,7 +195,6 @@ static void delayed_work_timer_fn(unsigned long __data) · 194 unmodified lines
195195 int queue_delayed_work(struct workqueue_struct *wq,
196196 struct delayed_work *dwork, unsigned long delay)
197197 {
198− timer_stats_timer_set_start_info(&dwork->timer);
199198 if (delay == 0)
200199 return queue_work(wq, &dwork->work);
201200
@@ -219,11 +218,12 @@ int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, · 17 unmodified lines
219218 struct timer_list *timer = &dwork->timer;
220219 struct work_struct *work = &dwork->work;
221220
222− timer_stats_timer_set_start_info(&dwork->timer);
223221 if (!test_and_set_bit(WORK_STRUCT_PENDING, work_data_bits(work))) {
224222 BUG_ON(timer_pending(timer));
225223 BUG_ON(!list_empty(&work->entry));
226224
225+ timer_stats_timer_set_start_info(&dwork->timer);
226+
227227 /* This stores cwq for the moment, for the timer_fn */
228228 set_wq_data(work, wq_per_cpu(wq, raw_smp_processor_id()));
229229 timer->expires = jiffies + delay;
@@ -564,7 +564,6 @@ EXPORT_SYMBOL(schedule_work); · 334 unmodified lines
564564 int schedule_delayed_work(struct delayed_work *dwork,
565565 unsigned long delay)
566566 {
567− timer_stats_timer_set_start_info(&dwork->timer);
568567 return queue_delayed_work(keventd_wq, dwork, delay);
569568 }
570569 EXPORT_SYMBOL(schedule_delayed_work);
@@ -581,7 +580,6 @@ EXPORT_SYMBOL(schedule_delayed_work); · 10 unmodified lines
581580 int schedule_delayed_work_on(int cpu,
582581 struct delayed_work *dwork, unsigned long delay)
583582 {
584− timer_stats_timer_set_start_info(&dwork->timer);
585583 return queue_delayed_work_on(cpu, keventd_wq, dwork, delay);
586584 }
587585 EXPORT_SYMBOL(schedule_delayed_work_on);