Re: [PATCH 1/2] sched/core: Get rid of 'cpu' argument in wq_worker_sleeping()
From: Oleg Nesterov
Date: Mon Feb 29 2016 - 14:09:57 EST
On 02/28, Alexander Gordeev wrote:
>
> -struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu)
> +struct task_struct *wq_worker_sleeping(struct task_struct *task)
> {
> struct worker *worker = kthread_data(task), *to_wakeup = NULL;
> struct worker_pool *pool;
> @@ -886,7 +886,7 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu)
> pool = worker->pool;
>
> /* this can only happen on the local cpu */
> - if (WARN_ON_ONCE(cpu != raw_smp_processor_id() || pool->cpu != cpu))
> + if (WARN_ON_ONCE(pool->cpu != smp_processor_id()))
> return NULL;
I think both changes are fine, but perhaps it would be better to keep
raw_smp_processor_id(). Unless you did this on purpose, but then it makes
sense to add a note into the changelog.
Oleg.