Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4936689yba; Tue, 30 Apr 2019 06:47:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIq1gifbJMFluIp0o99rShqzsxDg2983qPkVXZGtFq4yZCbhDBzMtliu1RpGdERclQ+9R4 X-Received: by 2002:a65:5189:: with SMTP id h9mr65256097pgq.304.1556632026038; Tue, 30 Apr 2019 06:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556632026; cv=none; d=google.com; s=arc-20160816; b=cMa0STHD/S04WKrzkjTLZOjookpdHkY5cKEsAoZ2LrI0qznnJpR3wN6d3qsi+QCZB/ RKiHcYD9zDUQ29JG0FW8BNcmL+zd+qowQwsbPqrgTSnwh5lu0ap8Bt2dtH0YwGsIInoP suebjym+xcsTj+xM6yHXlcgoO8Z1cvd7Q/gjvGwoQ/fGROXXxeaBdYaU4IKzfO5I2lMw dIt7ow1KiVhdNTs4ErOD2qoPY5Qtdf0Q6Eh2lcudmScXyPTYNORQCWU+zz//V9Je5j+0 GlgZDPw14AWz7FdB5d2Hoxse/8DW4/uZfM8T62biH53F/Wpo+ZNIzDaxYDgAUAEPWefU lDKw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=mubQRV2h4pzfBVeL0NdA7Dilf0OvsmiyzMdxDC5IuYM=; b=d/NJVDOk5obe3ox42u4MImXUOZe4ZdlQaoNjyEr2RjvWHp1uvxgwi9gSM05N9nVX01 BkXqbBN+BBdw4t+ojozuh2ZS/lzWGC4Od7znGNYf4v7pRGqncuDUizFVB7fwsUwoRGMt y9t+xIeE0yJDDDjQtiPhWNofc3D5t0k+d0i3L0q6LPvt8hRnMnthzWw9iBTNzX1sAJ69 a5UV9WHJ2zdu6H7ShDS+70rSSL+HpuOn73QVPySJs6IZJq/4Q1pERil65xM7Tflqb/M1 RKHSQiUsU1ezJnLjYab6YlZDYENiaDgjT3OXchMSmoOdqHPvi4VAylCSNn1hZxAFKvjk VM/Q== ARC-Authentication-Results: i=1; mx.google.com; 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 22si36759288pgn.171.2019.04.30.06.46.48; Tue, 30 Apr 2019 06:47:06 -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; 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 S1727066AbfD3Npv convert rfc822-to-8bit (ORCPT + 99 others); Tue, 30 Apr 2019 09:45:51 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:47342 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbfD3Npv (ORCPT ); Tue, 30 Apr 2019 09:45:51 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1hLT4u-0000OZ-9a; Tue, 30 Apr 2019 15:45:48 +0200 Date: Tue, 30 Apr 2019 15:45:48 +0200 From: Sebastian Andrzej Siewior To: Peter Zijlstra Cc: linux-rt-users , LKML , Thomas Gleixner , Daniel Bristot de Oliveira , Clark Williams , Juri Lelli , Oleg Nesterov , jack@suse.com Subject: Re: [RT WARNING] DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) != current) with fsfreeze (4.19.25-rt16) Message-ID: <20190430134547.lll7kjrslh3zat2b@linutronix.de> References: <20190326093421.GA29508@localhost.localdomain> <20190419085627.GI4742@localhost.localdomain> <20190430125130.uw7mhdnsoqr2v3gf@linutronix.de> <20190430132811.GB2589@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20190430132811.GB2589@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-04-30 15:28:11 [+0200], Peter Zijlstra wrote: > On Tue, Apr 30, 2019 at 02:51:31PM +0200, Sebastian Andrzej Siewior wrote: > > On 2019-04-19 10:56:27 [+0200], Juri Lelli wrote: > > > On 26/03/19 10:34, Juri Lelli wrote: > > > > Hi, > > > > > > > > Running this reproducer on a 4.19.25-rt16 kernel (with lock debugging > > > > turned on) produces warning below. > > > > > > And I now think this might lead to an actual crash. > > > > Peter, could you please take a look at the thread: > > https://lkml.kernel.org/r/20190419085627.GI4742@localhost.localdomain > > > > I assumed that returning to userland with acquired locks is something we > > did not want… > > 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? I have to re-route most of this questions to Juri Lelli. Lockdep has these gems: lockdep_sb_freeze_release() / lockdep_sb_freeze_acquire() Sebastian