Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6419806yba; Wed, 1 May 2019 11:55:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdwmXiuHEir9LiqAtSBN/nt8XApU9H+iylY8+iVKUmWiui2Q9QDxYNWmEt7JNtWChIa/aT X-Received: by 2002:a63:5720:: with SMTP id l32mr46455042pgb.438.1556736920338; Wed, 01 May 2019 11:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556736920; cv=none; d=google.com; s=arc-20160816; b=DfcSNrx5kOpMc26KbFD1EboueWTSbCaQl4C3xC4XvO00tv2A8eTsrQd5lfqmqvmjN7 0CsoJkwY5zXpQDjwbuGbXTbHzk2XNoc/n4IbXJA9enOV/dYypkKGgO5rzAKLI2qgUsCy qdBum5JfGEcHSqfMPY4jZGz6sGi1A0c10SFoaJyIVtiV/c2uyFwsYBtRV3xhBzk0ccq5 YYccR3k6F7GJgjp8twhUnv0R+VFHTKVYQA4FXO3ZJn2Z4bXD6jrtGM4Dv/OzFqCTFmmD 61E7vkK3gDie9aIiwmRaWpYiTC6OrrHxL2WwAO+6AeZF3dxLmo1wxFLwkByU0IjfpWjS fPyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mIUlTqn6wXkiuEWJTRY2AWbGrT0fqFXBa6GVgICMsZg=; b=o2IKzDsYea5g3RWlPpesIRr26uHgHvt3uQCHY0nguF/MLzsmTRpE+ytcztYhU0yvqA THLXi/6gVfBwTlr8gGOU08xYG7/vNn7cPeWY+5sy5WDBey7JOX8ghtXMugf5jUAAOXid EB1ah1drRVlZBGK6b9peRWVgJ1/eSXu4D4UUomoYVtMwuUHQygwVbSBa4/Mt30h1mioZ Y67XreqlbujqjMk3MUUDQk5DFejkPPwJ7hMLbfH963n9BRBh9xl2Bg9gGXxwN1/mz/NF eR09rE7hZXzAdMUazoIGVeLzjppdVnany9Ea37rrfOe0X5ZiK7p8SXuVhW31jxOTj5NQ TVgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=cZtAbaPU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24si27994726pgh.320.2019.05.01.11.55.04; Wed, 01 May 2019 11:55:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=cZtAbaPU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbfEASyL (ORCPT + 99 others); Wed, 1 May 2019 14:54:11 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47624 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbfEASyL (ORCPT ); Wed, 1 May 2019 14:54:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mIUlTqn6wXkiuEWJTRY2AWbGrT0fqFXBa6GVgICMsZg=; b=cZtAbaPU0seeywoUsS+mL9FNN wgQK8SIjmW4Ud5TVI4TTGPQA03RBCRkmxIK9mDDrB28g2tmT/pcfJLbkHFxdOtZRhlYkNpdvqLiD7 2+quQLFdEjQCrQGvWHbziSUuc7curcbqYaVcrIcPXsFOYJK0CGj6yOnPKKuRnpm94pXp+oz6i6IIo 8rE+WFEeqapcu32Rupj1qi6mCbEvUpSv3fLD0cLrEKwhOrZF7IfVD8JS0lA5i7z+LcLTVx+LV7bKG tAe+ZtyymPighUulm2vDyqJ8lWCN+RleTtSYh81nrsjeyomD5WO3fUzwxf8N7zmraQQ8Q64FougBk c592qFNGw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLuMm-0002oG-3g; Wed, 01 May 2019 18:54:04 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 4DB27984EB4; Wed, 1 May 2019 20:54:00 +0200 (CEST) Date: Wed, 1 May 2019 20:54:00 +0200 From: Peter Zijlstra To: Waiman Long Cc: Sebastian Andrzej Siewior , linux-rt-users , LKML , Thomas Gleixner , Daniel Bristot de Oliveira , Clark Williams , Juri Lelli , Oleg Nesterov , jack@suse.com, Davidlohr Bueso Subject: Re: [RT WARNING] DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) != current) with fsfreeze (4.19.25-rt16) Message-ID: <20190501185400.GQ7905@worktop.programming.kicks-ass.net> References: <20190326093421.GA29508@localhost.localdomain> <20190419085627.GI4742@localhost.localdomain> <20190430125130.uw7mhdnsoqr2v3gf@linutronix.de> <20190430132811.GB2589@hirez.programming.kicks-ass.net> <20190501170953.GB2650@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 01, 2019 at 01:26:08PM -0400, Waiman Long wrote: > On 5/1/19 1:09 PM, Peter Zijlstra wrote: > > On Tue, Apr 30, 2019 at 03:28:11PM +0200, Peter Zijlstra wrote: > > > >> Yeah, but AFAIK fs freezing code has a history of doing exactly that.. > >> This is just the latest incarnation here. > >> > >> So the immediate problem here is that the task doing thaw isn't the same > >> that did freeze, right? The thing is, I'm not seeing how that isn't a > >> problem with upstream either. > >> > >> The freeze code seems to do: percpu_down_write() for the various states, > >> and then frobs lockdep state. > >> > >> Thaw then does the reverse, frobs lockdep and then does: percpu_up_write(). > >> > >> percpu_down_write() directly relies on down_write(), and > >> percpu_up_write() on up_write(). And note how __up_write() has: > >> > >> DEBUG_RWSEMS_WARN_ON(sem->owner != current, sem); > >> > >> So why isn't this same code coming unstuck in mainline? > > That code is in just in the tip tree. It is not in the mainline yet. I > do realize that it can be a problem and so I have it modified to the > following in my part2 patchset. Nah, the percpu_rwsem abuse by the freezer is atrocious, we really should not encourage that. Also, it completely wrecks -RT. Hence the proposed patch.