Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6348543yba; Wed, 1 May 2019 10:27:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJVTPrvwE09ZX2afFe1dTR2dRaZ9dqq5AnFpap69+FzDVTRnWORi+G+pNnIhCqtXLnr3Dt X-Received: by 2002:a63:5b58:: with SMTP id l24mr72593155pgm.139.1556731644935; Wed, 01 May 2019 10:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556731644; cv=none; d=google.com; s=arc-20160816; b=zHM85evny05Rr4UDuIHeKPKIVRVZrS/rRcjaShxNl3BxiCaWNbwxG/fGQftK8mI9DR x77e2o2QKzHnSg1XoOuNZ4NdJzZs8eFM2WCxcnHVD/PGOH6XWsjmCa5/JH6WwCjB3x4h qmPKLbkSwsujv9CxO23YFC6JOdgfgiJZ9amAWeM5I4y07odQLAgvJmNR4D2Fz31fvmy3 pykmnAjaeythdsq/KgLUm8Hj0bxa7w56ZBEHYJaiUiOS7vNZThOpxkL/bRTcHS/GqjWq RhfblcVdQXG/UHYNQN3rYPufeLYVrx3Ap7SGyoyOUuHknvP4AA++go3dASPvkyo9CTRM H7fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=XelQHtLQ/RubEGkb9zsWO9BP9L7931sdw4MuiLa4Slw=; b=aLqcg7I7Zoq11avJj9teno0BTgrY/BzmPdahoMVMxlti5m54AOmGf6BXa+ZxdK7TTU pzBXEcEkR7ekHdNVn5mfqQUEDLfP3DlkVgmqP4dGxsDmk7y22A9VacHDGfBQd0R5Mxs3 ocX2Uf73waUhTBU4wapS8GHZgCUVQ59KD62sfa/zxjmv9iyBFiK9nDfdNnINrPTgeyNW qn6veL0RGZRXbf4HovVdWmPcBFeXjAEBBMj6V0rhWnSzupkLRmRZNdz2c0RwPI4HtmK6 Xox3YJatWMJmK5UXNTdcJr5nFiagNm2sU9XLQ5ao/GQwhq9AMMfc+qcvN8SymAK12Szp 8rwg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m186si29977744pfb.96.2019.05.01.10.27.09; Wed, 01 May 2019 10:27:24 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726137AbfEAR0U (ORCPT + 99 others); Wed, 1 May 2019 13:26:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41125 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726069AbfEAR0U (ORCPT ); Wed, 1 May 2019 13:26:20 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D74803084248; Wed, 1 May 2019 17:26:19 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-85.bos.redhat.com [10.18.17.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 587D776114; Wed, 1 May 2019 17:26:09 +0000 (UTC) Subject: Re: [RT WARNING] DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) != current) with fsfreeze (4.19.25-rt16) To: Peter Zijlstra , Sebastian Andrzej Siewior Cc: linux-rt-users , LKML , Thomas Gleixner , Daniel Bristot de Oliveira , Clark Williams , Juri Lelli , Oleg Nesterov , jack@suse.com, Davidlohr Bueso 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> From: Waiman Long Organization: Red Hat Message-ID: Date: Wed, 1 May 2019 13:26:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190501170953.GB2650@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 01 May 2019 17:26:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. static inline void __up_write(struct rw_semaphore *sem) {         long tmp;         /*          * sem->owner may differ from current if the ownership is transferred          * to an anonymous writer by setting the RWSEM_NONSPINNABLE bits.          */         DEBUG_RWSEMS_WARN_ON((sem->owner != current) &&                             !((long)sem->owner & RWSEM_NONSPINNABLE), sem); Maybe I should break this part out and have it merged into tip as well. Cheers, Longman