All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: syzbot <syzbot+b70f2aabc707c69c9239@syzkaller.appspotmail.com>,
	chanho.min@lge.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, pavel@ucw.cz,
	rafael.j.wysocki@intel.com, syzkaller-bugs@googlegroups.com,
	viro@zeniv.linux.org.uk, Ingo Molnar <mingo@elte.hu>
Subject: Re: WARNING: syz-executor still has locks held!
Date: Wed, 20 Mar 2019 18:30:42 +0100	[thread overview]
Message-ID: <20190320173041.GE21673@redhat.com> (raw)
In-Reply-To: <20190320151242.GC8696@dhcp22.suse.cz>

On 03/20, Michal Hocko wrote:
>
> [Cc Ingo and Chanho Min - the thread starts here
> http://lkml.kernel.org/r/0000000000004cdec6058485b2ce@google.com]
>
> On Wed 20-03-19 16:00:54, Oleg Nesterov wrote:
> > 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".
>
> But the fundamental semantic is the same right? Both might be sitting on
> locks that might interfere with other tasks and we should be _extra_
> careful when using them. In an ideal world, none of them is really
> needed.

Ah, it seems that we misunderstood each other... see below.

> So my question remains. Can we drop the warning for PF_FREEZER_SKIP
> tasks as well?

But why? It is obviously wrong to call try_to_freeze() with a lock held.

Probably you meant the

	if (!(current->flags & PF_NOFREEZE))

check in try_to_freeze() when you said "already ignores PF_NOFREEZE tasks".

I am not sure we actually need this check, a PF_NOFREEZE kthread shouldn't
call try_to_freeze() at least directly.

However, note that freezing() will return false if PF_NOFREEZE is set, so
try_to_freeze() is nop in this case. Probably this is why PF_NOFREEZE is
also checked before debug_check_no_locks_held().

> > > as removing the cgred is way way too complicated.
> >
> > We need to do this anyway, this leads to other more serious problems...
>
> Yes but this is far away and it doesn't really seem like a stable tree
> material

strace -f can hang ;) so this is the stable material.

Oleg.


  reply	other threads:[~2019-03-20 17:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-24 17:40 WARNING: syz-executor still has locks held! syzbot
2019-03-20 12:24 ` syzbot
2019-03-20 13:16   ` Michal Hocko
2019-03-20 13:24     ` Oleg Nesterov
2019-03-20 13:29       ` Michal Hocko
2019-03-20 15:00         ` Oleg Nesterov
2019-03-20 15:12           ` Michal Hocko
2019-03-20 17:30             ` Oleg Nesterov [this message]
2019-03-20 19:45               ` Michal Hocko
2019-03-20 20:32                 ` Michal Hocko
2019-03-21 17:28                   ` Oleg Nesterov
2019-03-22 10:36                     ` Michal Hocko
2019-03-22 10:35               ` Pavel Machek
2019-03-20 13:18   ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190320173041.GE21673@redhat.com \
    --to=oleg@redhat.com \
    --cc=chanho.min@lge.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mingo@elte.hu \
    --cc=pavel@ucw.cz \
    --cc=rafael.j.wysocki@intel.com \
    --cc=syzbot+b70f2aabc707c69c9239@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.