From: Tejun Heo <tj@kernel.org>
To: Austin Schuh <austin@peloton-tech.com>
Cc: Dave Chinner <david@fromorbit.com>, xfs <xfs@oss.sgi.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: On-stack work item completion race? (was Re: XFS crash?)
Date: Wed, 25 Jun 2014 10:00:05 -0400 [thread overview]
Message-ID: <20140625140005.GB26883@htj.dyndns.org> (raw)
In-Reply-To: <CANGgnMY5cBSXOayDbbOvqNXEG8e6sAYEjpWEQO2X8XPxx2R5-Q@mail.gmail.com>
Hello,
On Tue, Jun 24, 2014 at 08:05:07PM -0700, Austin Schuh wrote:
> > I can see no reason why manual completion would behave differently
> > from flush_work() in this case.
>
> I went looking for a short trace in my original log to show the problem,
> and instead found evidence of the second problem. I still like the shorter
> flush_work call, but that's not my call.
So, are you saying that the original issue you reported isn't actually
a problem? But didn't you imply that changing the waiting mechanism
fixed a deadlock or was that a false positive?
> I did find this comment in the process_one_work function. Sounds like this
> could be better documented.
Yeah, we prolly should beef up Documentation/workqueue.txt with
information on general usage.
> I spent some more time debugging, and I am seeing that tsk_is_pi_blocked is
> returning 1 in sched_submit_work (kernel/sched/core.c). It looks
> like sched_submit_work is not detecting that the worker task is blocked on
> a mutex.
The function unplugs the block layer and doesn't have much to do with
workqueue although it has "_work" in its name.
> This looks very RT related right now. I see 2 problems from my reading
> (and experimentation). The first is that the second worker isn't getting
> started because tsk_is_pi_blocked is reporting that the task isn't blocked
> on a mutex. The second is that even if another worker needs to be
> scheduled because the original worker is blocked on a mutex, we need the
> pool lock to schedule another worker. The pool lock can be acquired by any
> CPU, and is a spin_lock. If we end up on the slow path for the pool lock,
> we hit BUG_ON(rt_mutex_real_waiter(task->pi_blocked_on))
> in task_blocks_on_rt_mutex in rtmutex.c. I'm not sure how to deal with
> either problem.
>
> Hopefully I've got all my facts right... Debugging kernel code is a whole
> new world from userspace code.
I don't have much idea how RT kernel works either. Can you reproduce
the issues that you see on mainline?
Thanks.
--
tejun
next prev parent reply other threads:[~2014-06-25 14:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140305233551.GK6851@dastard>
[not found] ` <CANGgnMb=2dYGQO4K36pQ9LEb8E4rT6S_VskLF+n=ndd0_kJr_g@mail.gmail.com>
[not found] ` <CANGgnMa80WwQ8zSkL52yYegmQURVQeZiBFv41=FQXMZJ_NaEDw@mail.gmail.com>
[not found] ` <20140513034647.GA5421@dastard>
[not found] ` <CANGgnMZ0q9uE3NHj2i0SBK1d0vdKLx7QBJeFNb+YwP-5EAmejQ@mail.gmail.com>
[not found] ` <20140513063943.GQ26353@dastard>
[not found] ` <CANGgnMYn++1++UyX+D2d9GxPxtytpQJv0ThFwdxM-yX7xDWqiA@mail.gmail.com>
[not found] ` <20140513090321.GR26353@dastard>
[not found] ` <CANGgnMZqQc_NeaDpO_aX+bndmHrQ9VWo9mkfxhPBkRD-J=N6sQ@mail.gmail.com>
[not found] ` <CANGgnMZ8OwzfBj5m9H7c6q2yahGhU7oFZLsJfVxnWoqZExkZmQ@mail.gmail.com>
2014-06-24 3:02 ` Dave Chinner
2014-06-24 3:25 ` Tejun Heo
2014-06-25 3:16 ` Austin Schuh
2014-06-25 5:56 ` Dave Chinner
2014-06-25 14:18 ` Tejun Heo
2014-06-25 22:08 ` Dave Chinner
[not found] ` <CANGgnMY5cBSXOayDbbOvqNXEG8e6sAYEjpWEQO2X8XPxx2R5-Q@mail.gmail.com>
2014-06-25 14:00 ` Tejun Heo [this message]
2014-06-25 17:04 ` Austin Schuh
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=20140625140005.GB26883@htj.dyndns.org \
--to=tj@kernel.org \
--cc=austin@peloton-tech.com \
--cc=david@fromorbit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=xfs@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®