Re: [PATCH 03/13] workqueue: don't set work cwq until we queued it on pool

Tejun Heo
2013-02-06T14:18:15Z

Hello, Lai.

On Wed, Feb 06, 2013 at 07:35:24PM +0800, Lai Jiangshan wrote:
> > @lcpu is never WORK_CPU_UNBOUND for bound workqueues and for unbound
> > workqueues we of course have cwq for WORK_CPU_UNBOUND.
>
>
> Are you sure?
> @lcpu is only used when it tries to set cwq to work data without
> breaking nrt logic.
>
> void delayed_work_timer_fn(unsigned long __data)
> {
> struct delayed_work *dwork = (struct delayed_work *)__data;
> struct cpu_workqueue_struct *cwq = get_work_cwq(&dwork->work);
>
> /* should have been called from irqsafe timer with irq already off */
> __queue_work(dwork->cpu, cwq->wq, &dwork->work);
> }

Ah, you're right. I was confused about ->cpu and cwq in ->data.
Yeah, let's just add ->wq as the original patch.

Thanks.

--
tejun