Re: [PATCH v4 1/1] workqueue: ignore dead tasks in a workqueue sleep hook

2016-10-26 Thread Roman Penyaev
On Wed, Oct 26, 2016 at 4:18 PM, Oleg Nesterov wrote: > On 10/25, Roman Pen wrote: >> >> void wq_worker_waking_up(struct task_struct *task, int cpu) >> { >> - struct worker *worker = kthread_data(task); >> + struct worker *worker; >> + >> + if (task->flags & PF_EXITING) { >> +

Re: [PATCH v4 1/1] workqueue: ignore dead tasks in a workqueue sleep hook

2016-10-26 Thread Oleg Nesterov
On 10/25, Roman Pen wrote: > > void wq_worker_waking_up(struct task_struct *task, int cpu) > { > - struct worker *worker = kthread_data(task); > + struct worker *worker; > + > + if (task->flags & PF_EXITING) { > + /* > + * Careful here, t->vfork_done is zeroed

[PATCH v4 1/1] workqueue: ignore dead tasks in a workqueue sleep hook

2016-10-25 Thread Roman Pen
If panic_on_oops is not set and oops happens inside workqueue kthread, kernel kills this kthread. Current patch fixes recursive GPF which happens when wq_worker_sleeping() function unconditionally accesses the NULL kthread->vfork_done ptr thru kthread_data() -> to_kthread(). The stack is the foll