Re: [patch 4/4] sched: Distangle worker accounting from rq->lock

From: Thomas Gleixner
Date: Wed Jun 22 2011 - 15:30:18 EST


On Wed, 22 Jun 2011, Thomas Gleixner wrote:
> +void wq_worker_sleeping(struct task_struct *task)
> {
> - struct worker *worker = kthread_data(task), *to_wakeup = NULL;
> - struct global_cwq *gcwq = get_gcwq(cpu);
> - atomic_t *nr_running = get_gcwq_nr_running(cpu);
> + struct worker *worker = kthread_data(task);
> + struct global_cwq *gcwq;
> + int cpu;
>
> if (worker->flags & WORKER_NOT_RUNNING)
> - return NULL;
> + return;
>
> - /* this can only happen on the local cpu */
> - BUG_ON(cpu != raw_smp_processor_id());
> + if (WARN_ON_ONCE(worker->sleeping))
> + return;

Darn, forgot to add

worker->sleeping = 1;

back when I added the WARN_ON.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/