Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7121713yba; Thu, 2 May 2019 04:46:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrLUsk2qXvc1Ih0D15ZQ5icBK6T64MzZT6zG2HWGkzxo+Kkt/5ELQLE9OYWPcUbLVxLQWg X-Received: by 2002:a62:81c1:: with SMTP id t184mr3646643pfd.221.1556797562722; Thu, 02 May 2019 04:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556797562; cv=none; d=google.com; s=arc-20160816; b=nFhLD37zD+lUM8QXB9hsFIjDsgWSSYaZb9+dAjzG5u8VhSyYEOPIOQnvpCnB3RONJs 6tei5IjxN1yYGFotX1QwYik1bX13skuTCSGcGNFvcR//7mpROlXy4JmyXHufCiNBFv2i J71tjmXmTZ9TR2P4raN4T6/1ZWYiBa2E6MWEstAm4p7yT952Ia7BzjCuB0xOdZXnDFDE mgW16Wbc6JlZoYbRilu1DtsZq+Ecavt1cvnBseVwPqjsnRKIAuKVUyzuW67x5C5Zbmq6 KQA6KGoBhEzh1fqpfploku5qmB44qjlF5b7JphFd9eg1B3HB8CpnyEeHaZnct6Rvbys0 etmA== 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; bh=ZzQaNMkYeqkskY7d4HNEr2IkSeOsjysCDizKAYSFQnM=; b=sxc8nTtYdh5gFfVOtouWppJD17FSYRkYWnHj/ANrTHZnbdQhyQnA0veIYJgDoGuZnp QquFVLvoWI2AfZlo1uXY6+vp6o3WZJMYIoac0ThYgQKKjPux6LG0rpHrruusTq58FVgC vWx+I8eUmnxeAYdsnZh8QN2jtjkvnIkwbrOnc/w0P65MYTeWWMfacH5/wq+zos4wzOd3 fyeHCtdKIzgkd3/EyPZXLe78eT7vkU4IJjT02CHwYX+qERMWji31d3OvavJyjdCbNLwc HJFWBuX/U5H1pyOIPfQirFiHNBgRvNgO2u/f9fWd8ulx5lHLq2xfm8VxXiaEAKAkAF1x W2yw== 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 k12si42717095plt.28.2019.05.02.04.45.47; Thu, 02 May 2019 04:46:02 -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 S1726434AbfEBLnL (ORCPT + 99 others); Thu, 2 May 2019 07:43:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53490 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbfEBLnK (ORCPT ); Thu, 2 May 2019 07:43:10 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65D8089C42; Thu, 2 May 2019 11:43:10 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.159]) by smtp.corp.redhat.com (Postfix) with SMTP id 9F51739C1; Thu, 2 May 2019 11:43:01 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 2 May 2019 13:43:08 +0200 (CEST) Date: Thu, 2 May 2019 13:42:59 +0200 From: Oleg Nesterov To: Peter Zijlstra Cc: Sebastian Andrzej Siewior , linux-rt-users , LKML , Thomas Gleixner , Daniel Bristot de Oliveira , Clark Williams , Juri Lelli , jack@suse.com, Waiman Long , Davidlohr Bueso Subject: Re: [RT WARNING] DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) != current) with fsfreeze (4.19.25-rt16) Message-ID: <20190502114258.GB7323@redhat.com> 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> <20190502100932.GA7323@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190502100932.GA7323@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 02 May 2019 11:43:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/02, Oleg Nesterov wrote: > > But this all is cosmetic, it seems that we can remove ->rw_sem altogether > but I am not sure... I mean, afaics percpu_down_read() can just do wait_event(readers_block == 0); in the slow path, while percpu_down_write() wait_even_exclusive(xchg(readers_block, 1) == 0); we do not really need ->rw_sem if we rely on wait_queue_head. But in fact, either way it seems that we going to implement another simple "non owner" read/write lock, so perhaps we should do this explicitly? Oleg.