Re: [RFC] better visibility into kworkers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, Lai.

On Thu, May 17, 2018 at 09:50:00PM +0800, Lai Jiangshan wrote:
> > +void wq_worker_comm(char *buf, size_t size, struct task_struct *task)
> > +{
> > +       struct worker *worker;
> > +       struct worker_pool *pool;
> > +
> > +       mutex_lock(&wq_pool_attach_mutex);
> > +
> 
> Need to recheck
> task->flags | PF_WQ_WORKER
> again, because @task is often not the current task,
> the worker returned by kthread_data(task)
> could have been freed when the worker
> was destroyed.

Hmm... but we're pinning the task and kthread_data doesn't get freed
till the task is released.  I don't see how the worker could go away.

...
> BTW, is it possible to keep attach_mutex
> unchanged? rcu_sched might be enough.

It's simpler to use a global mutex, no?

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux