From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754712AbdJIPY6 (ORCPT ); Mon, 9 Oct 2017 11:24:58 -0400 Received: from merlin.infradead.org ([205.233.59.134]:58500 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754151AbdJIPY4 (ORCPT ); Mon, 9 Oct 2017 11:24:56 -0400 Date: Mon, 9 Oct 2017 17:24:49 +0200 From: Peter Zijlstra To: Lai Jiangshan Cc: Boqun Feng , LKML , Josef Bacik , Tejun Heo , Thomas Gleixner Subject: Re: [RFC] workqueue: Fix irq inversion deadlock in manage_workers() Message-ID: <20171009152449.yrqcdhvldgptt4zb@hirez.programming.kicks-ass.net> References: <20171008090225.27034-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.