mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Boqun Feng <boqun.feng@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Josef Bacik <josef@toxicpanda.com>, Tejun Heo <tj@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC] workqueue: Fix irq inversion deadlock in manage_workers()
Date: Mon, 9 Oct 2017 17:24:49 +0200	[thread overview]
Message-ID: <20171009152449.yrqcdhvldgptt4zb@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAJhGHyAqKWJHT=_38338bQmqG4HZuz=5-J3J0H4yM3GVDK319w@mail.gmail.com>

On Mon, Oct 09, 2017 at 05:40:43PM +0800, Lai Jiangshan wrote:
> I didn't thought this kind of pattern is very seldom.  I remember I saw several.

>   mutex_lock();
>   do_something();
>   spin_lock_irq();
>   record_the_state_for_ do_something().
>    // keep the spin lock held to hold the state for do_more_things().
>   mutex_unlock(); // unlock() is suggested to be called when just exiting C.S.
>   do_more_things();
>   spin_unlock_irq();
> 
> Was all code of this pattern removed?
> Could it be possible that mutex will be changed to allow this?

So I think we did something similar to the rt_mutex in:

  b4abf91047cf ("rtmutex: Make wait_lock irq safe")

And I would not be entirely against doing the same for our normal mutex,
but I've not really had time to read/think through this thread.

  parent reply	other threads:[~2017-10-09 15:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-08  9:02 Boqun Feng
2017-10-08 19:03 ` Tejun Heo
2017-10-09  3:24   ` Boqun Feng
2017-10-09  6:42   ` Peter Zijlstra
2017-10-09 13:07     ` Tejun Heo
2017-10-09  9:40 ` Lai Jiangshan
2017-10-09 12:40   ` Boqun Feng
2017-10-09 15:24   ` Peter Zijlstra [this message]
2017-10-09 15:29     ` Tejun Heo
2017-10-09 13:21 ` [PATCH workqueue/for-4.14-fixes] workqueue: replace pool->manager_arb mutex with a flag Tejun Heo
2017-10-09 14:21   ` Boqun Feng
2017-10-09 14:47     ` Tejun Heo
2017-10-09 15:02   ` Lai Jiangshan
2017-10-09 15:08     ` Tejun Heo
2017-10-09 15:14       ` Lai Jiangshan
2017-10-09 15:33         ` Tejun Heo
2017-10-09 15:04   ` [PATCH v2 " Tejun Heo
2017-10-10  9:55     ` Lai Jiangshan
2017-10-10 14:15     ` Tejun Heo

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=20171009152449.yrqcdhvldgptt4zb@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=boqun.feng@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /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®