Skip to content

Commit ef504fa

Browse files
committed
Merge branch 'for-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue updates from Tejun Heo: "Three trivial workqueue changes" * 'for-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Fix comment for work_on_cpu() sched/core: Get rid of 'cpu' argument in wq_worker_sleeping() workqueue: Replace usage of init_name with dev_set_name()
2 parents 814a2bf + 22aceb3 commit ef504fa

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3174,7 +3174,7 @@ static void __sched notrace __schedule(bool preempt)
31743174
if (prev->flags & PF_WQ_WORKER) {
31753175
struct task_struct *to_wakeup;
31763176

3177-
to_wakeup = wq_worker_sleeping(prev, cpu);
3177+
to_wakeup = wq_worker_sleeping(prev);
31783178
if (to_wakeup)
31793179
try_to_wake_up_local(to_wakeup);
31803180
}

kernel/workqueue.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,6 @@ void wq_worker_waking_up(struct task_struct *task, int cpu)
857857
/**
858858
* wq_worker_sleeping - a worker is going to sleep
859859
* @task: task going to sleep
860-
* @cpu: CPU in question, must be the current CPU number
861860
*
862861
* This function is called during schedule() when a busy worker is
863862
* going to sleep. Worker on the same cpu can be woken up by
@@ -869,7 +868,7 @@ void wq_worker_waking_up(struct task_struct *task, int cpu)
869868
* Return:
870869
* Worker task on @cpu to wake up, %NULL if none.
871870
*/
872-
struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu)
871+
struct task_struct *wq_worker_sleeping(struct task_struct *task)
873872
{
874873
struct worker *worker = kthread_data(task), *to_wakeup = NULL;
875874
struct worker_pool *pool;
@@ -885,7 +884,7 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu)
885884
pool = worker->pool;
886885

887886
/* this can only happen on the local cpu */
888-
if (WARN_ON_ONCE(cpu != raw_smp_processor_id() || pool->cpu != cpu))
887+
if (WARN_ON_ONCE(pool->cpu != raw_smp_processor_id()))
889888
return NULL;
890889

891890
/*
@@ -4695,7 +4694,7 @@ static void work_for_cpu_fn(struct work_struct *work)
46954694
}
46964695

46974696
/**
4698-
* work_on_cpu - run a function in user context on a particular cpu
4697+
* work_on_cpu - run a function in thread context on a particular cpu
46994698
* @cpu: the cpu to run on
47004699
* @fn: the function to run
47014700
* @arg: the function arg
@@ -5221,8 +5220,8 @@ int workqueue_sysfs_register(struct workqueue_struct *wq)
52215220

52225221
wq_dev->wq = wq;
52235222
wq_dev->dev.bus = &wq_subsys;
5224-
wq_dev->dev.init_name = wq->name;
52255223
wq_dev->dev.release = wq_device_release;
5224+
dev_set_name(&wq_dev->dev, "%s", wq->name);
52265225

52275226
/*
52285227
* unbound_attrs are created separately. Suppress uevent until

kernel/workqueue_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ static inline struct worker *current_wq_worker(void)
6969
* sched/core.c and workqueue.c.
7070
*/
7171
void wq_worker_waking_up(struct task_struct *task, int cpu);
72-
struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu);
72+
struct task_struct *wq_worker_sleeping(struct task_struct *task);
7373

7474
#endif /* _KERNEL_WORKQUEUE_INTERNAL_H */

0 commit comments

Comments
 (0)