Re: [PATCH v2] exec: make de_thread() freezable

2018-11-21 Thread Rafael J. Wysocki
On Monday, November 12, 2018 9:15:18 AM CET Oleg Nesterov wrote: > On 11/12, Chanho Min wrote: > > > > @@ -1083,7 +1084,7 @@ static int de_thread(struct task_struct *tsk) > > while (sig->notify_count) { > > __set_current_state(TASK_KILLABLE); > > spin_unlock_irq(lock); >

Re: [PATCH v2] exec: make de_thread() freezable

2018-11-14 Thread Oleg Nesterov
On 11/14, Michal Hocko wrote: > > > I don't understand why it isn't appropriate for exec to block. The > > exec can freeze. When tasks are thawed, the killed sub-thread will die > > and wake de_thread(). The exec will continue to work from resume. > > Because this is fragile. I don't really agree,

Re: [PATCH v2] exec: make de_thread() freezable

2018-11-14 Thread Oleg Nesterov
On 11/13, Michal Hocko wrote: > > > > > > > > > To fix this, make de_thread() freezable. It looks safe and works fine. > > > > > > It's been some time since I have looked into this code so bear with me. > > > One thing is not really clear to me. Why does it help to exclude this > > > particular tas

Re: [PATCH v2] exec: make de_thread() freezable

2018-11-14 Thread Michal Hocko
On Tue 13-11-18 15:53:39, Michal Hocko wrote: > On Mon 12-11-18 12:54:45, Chanho Min wrote: > > Suspend fails due to the exec family of functions blocking the freezer. > > The casue is that de_thread() sleeps in TASK_UNINTERRUPTIBLE waiting for > > all sub-threads to die, and we have the deadlock i

Re: [PATCH v2] exec: make de_thread() freezable

2018-11-14 Thread Michal Hocko
On Wed 14-11-18 19:18:42, Chanho Min wrote: > > > > It's been some time since I have looked into this code so bear with > me. > > > > One thing is not really clear to me. Why does it help to exclude this > > > > particular task from the freezer > > > > > > we don't exclude it, > > > > > > > when it

RE: [PATCH v2] exec: make de_thread() freezable

2018-11-14 Thread Chanho Min
> > > It's been some time since I have looked into this code so bear with me. > > > One thing is not really clear to me. Why does it help to exclude this > > > particular task from the freezer > > > > we don't exclude it, > > > > > when it is not sleeping in the freezer. > > > > Yes, it is not slee

Re: [PATCH v2] exec: make de_thread() freezable

2018-11-13 Thread Michal Hocko
On Tue 13-11-18 17:18:58, Oleg Nesterov wrote: > On 11/13, Michal Hocko wrote: > > > > On Mon 12-11-18 12:54:45, Chanho Min wrote: > > > Suspend fails due to the exec family of functions blocking the freezer. > > > The casue is that de_thread() sleeps in TASK_UNINTERRUPTIBLE waiting for > > > all s

Re: [PATCH v2] exec: make de_thread() freezable

2018-11-13 Thread Oleg Nesterov
On 11/13, Michal Hocko wrote: > > On Mon 12-11-18 12:54:45, Chanho Min wrote: > > Suspend fails due to the exec family of functions blocking the freezer. > > The casue is that de_thread() sleeps in TASK_UNINTERRUPTIBLE waiting for > > all sub-threads to die, and we have the deadlock if one of them

Re: [PATCH v2] exec: make de_thread() freezable

2018-11-13 Thread Michal Hocko
On Mon 12-11-18 12:54:45, Chanho Min wrote: > Suspend fails due to the exec family of functions blocking the freezer. > The casue is that de_thread() sleeps in TASK_UNINTERRUPTIBLE waiting for > all sub-threads to die, and we have the deadlock if one of them is frozen. > This also can occur with th

Re: [PATCH v2] exec: make de_thread() freezable

2018-11-12 Thread Pavel Machek
On Mon 2018-11-12 12:54:45, Chanho Min wrote: > Suspend fails due to the exec family of functions blocking the freezer. > The casue is that de_thread() sleeps in TASK_UNINTERRUPTIBLE waiting for > all sub-threads to die, and we have the deadlock if one of them is frozen. > This also can occur with

Re: [PATCH v2] exec: make de_thread() freezable

2018-11-12 Thread Oleg Nesterov
On 11/12, Chanho Min wrote: > > @@ -1083,7 +1084,7 @@ static int de_thread(struct task_struct *tsk) > while (sig->notify_count) { > __set_current_state(TASK_KILLABLE); > spin_unlock_irq(lock); > - schedule(); > + freezable_schedule(); >