Re: WARNING: syz-executor still has locks held!

From: Oleg Nesterov
Date: Wed Mar 20 2019 - 11:01:01 EST


On 03/20, Michal Hocko wrote:
>
> On Wed 20-03-19 14:24:11, Oleg Nesterov wrote:
> > On 03/20, Michal Hocko wrote:
> > >
> > > Yes we do hold the cgred mutex while calling freezable_schedule but why
> > > are we getting a warning is not really clear to me. The task should be
> > > hidden from the freezer so why do we warn at all?
> >
> > try_to_freeze() calls debug_check_no_locks_held() and this makes sense.
>
> Yes it does. But it already ignores PF_NOFREEZE tasks and I fail to see
> why is PF_FREEZER_SKIP any different.

But they differ. PF_NOFREEZE is a "sticky" flag for kthreads. Set by default,
cleared by set_freezable() if you want a freezable kthread.

PF_FREEZER_SKIP means that a sleeping freezable task will call try_to_freeze()
right after schedule() returns, so try_to_freeze_tasks() can safely count it as
"already frozen".

> it seems that skipping the task was the only viable option
> to fix suspend issues

Yes, de_thread() should use freezable_schedule(), iow I hope we will reconsider
this (reverted) patch.

> as removing the cgred is way way too complicated.

We need to do this anyway, this leads to other more serious problems...

Oleg.