History

Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq

* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq: Move workqueue exports to where the functions are defined. [CPUFREQ] Misc cleanups in ondemand. [CPUFREQ] Make ondemand sampling per CPU and remove the mutex usage in sampling path. [CPUFREQ] Add queue_delayed_work_on() interface for workqueues. [CPUFREQ] Remove slowdown from ondemand sampling path.

Linus Torvalds committed 20 years ago

Commit ca78f6b2 parents 7ad7153 ae90dd54 files · +127 −194Browse files

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

Unified · Split

kernel/workqueue.c+32−25
@@ -114,6 +114,7 @@ int fastcall queue_work(struct workqueue_struct *wq, struct work_struct *work) · 113 unmodified lines
114114 put_cpu();
115115 return ret;
116116 }
117+EXPORT_SYMBOL_GPL(queue_work);
117118
118119 static void delayed_work_timer_fn(unsigned long __data)
119120 {
@@ -147,6 +148,29 @@ int fastcall queue_delayed_work(struct workqueue_struct *wq, · 27 unmodified lines
147148 }
148149 return ret;
149150 }
151+EXPORT_SYMBOL_GPL(queue_delayed_work);
152+
153+int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
154+ struct work_struct *work, unsigned long delay)
155+{
156+ int ret = 0;
157+ struct timer_list *timer = &work->timer;
158+
159+ if (!test_and_set_bit(0, &work->pending)) {
160+ BUG_ON(timer_pending(timer));
161+ BUG_ON(!list_empty(&work->entry));
162+
163+ /* This stores wq for the moment, for the timer_fn */
164+ work->wq_data = wq;
165+ timer->expires = jiffies + delay;
166+ timer->data = (unsigned long)work;
167+ timer->function = delayed_work_timer_fn;
168+ add_timer_on(timer, cpu);
169+ ret = 1;
170+ }
171+ return ret;
172+}
173+EXPORT_SYMBOL_GPL(queue_delayed_work_on);
150174
151175 static void run_workqueue(struct cpu_workqueue_struct *cwq)
152176 {
@@ -281,6 +305,7 @@ void fastcall flush_workqueue(struct workqueue_struct *wq) · 128 unmodified lines
281305 unlock_cpu_hotplug();
282306 }
283307 }
308+EXPORT_SYMBOL_GPL(flush_workqueue);
284309
285310 static struct task_struct *create_workqueue_thread(struct workqueue_struct *wq,
286311 int cpu)
@@ -358,6 +383,7 @@ struct workqueue_struct *__create_workqueue(const char *name, · 71 unmodified lines
358383 }
359384 return wq;
360385 }
386+EXPORT_SYMBOL_GPL(__create_workqueue);
361387
362388 static void cleanup_workqueue_thread(struct workqueue_struct *wq, int cpu)
363389 {
@@ -395,6 +421,7 @@ void destroy_workqueue(struct workqueue_struct *wq) · 31 unmodified lines
395421 free_percpu(wq->cpu_wq);
396422 kfree(wq);
397423 }
424+EXPORT_SYMBOL_GPL(destroy_workqueue);
398425
399426 static struct workqueue_struct *keventd_wq;
400427
@@ -402,31 +429,20 @@ int fastcall schedule_work(struct work_struct *work) · 1 unmodified line
402429 {
403430 return queue_work(keventd_wq, work);
404431 }
432+EXPORT_SYMBOL(schedule_work);
405433
406434 int fastcall schedule_delayed_work(struct work_struct *work, unsigned long delay)
407435 {
408436 return queue_delayed_work(keventd_wq, work, delay);
409437 }
438+EXPORT_SYMBOL(schedule_delayed_work);
410439
411440 int schedule_delayed_work_on(int cpu,
412441 struct work_struct *work, unsigned long delay)
413442 {
414− int ret = 0;
415− struct timer_list *timer = &work->timer;
416−
417− if (!test_and_set_bit(0, &work->pending)) {
418− BUG_ON(timer_pending(timer));
419− BUG_ON(!list_empty(&work->entry));
420− /* This stores keventd_wq for the moment, for the timer_fn */
421− work->wq_data = keventd_wq;
422− timer->expires = jiffies + delay;
423− timer->data = (unsigned long)work;
424− timer->function = delayed_work_timer_fn;
425− add_timer_on(timer, cpu);
426− ret = 1;
427− }
428− return ret;
443+ return queue_delayed_work_on(cpu, keventd_wq, work, delay);
429444 }
445+EXPORT_SYMBOL(schedule_delayed_work_on);
430446
431447 /**
432448 * schedule_on_each_cpu - call a function on each online CPU from keventd
@@ -463,6 +479,7 @@ void flush_scheduled_work(void) · 30 unmodified lines
463479 {
464480 flush_workqueue(keventd_wq);
465481 }
482+EXPORT_SYMBOL(flush_scheduled_work);
466483
467484 /**
468485 * cancel_rearming_delayed_workqueue - reliably kill off a delayed
@@ -619,13 +636,3 @@ void init_workqueues(void) · 150 unmodified lines
619636 BUG_ON(!keventd_wq);
620637 }
621638
622−EXPORT_SYMBOL_GPL(__create_workqueue);
623−EXPORT_SYMBOL_GPL(queue_work);
624−EXPORT_SYMBOL_GPL(queue_delayed_work);
625−EXPORT_SYMBOL_GPL(flush_workqueue);
626−EXPORT_SYMBOL_GPL(destroy_workqueue);
627−
628−EXPORT_SYMBOL(schedule_work);
629−EXPORT_SYMBOL(schedule_delayed_work);
630−EXPORT_SYMBOL(schedule_delayed_work_on);
631−EXPORT_SYMBOL(flush_scheduled_work);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t