Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp703082yba; Fri, 3 May 2019 09:07:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOPmQm2X+fb62ov3D3cIF89KjmCcabHfnTws3vc41ajh2/yRSY/OzOM5BnxamIHbMqDFJM X-Received: by 2002:a65:584f:: with SMTP id s15mr7928805pgr.171.1556899637542; Fri, 03 May 2019 09:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556899637; cv=none; d=google.com; s=arc-20160816; b=ZdkqM77j6SOxIXIpedw0SZjPkXh0lYYPGH+I3p4I52/hKH8lkml1r1EbLZK8o8i0QO OjZdmymlcaDgj5Nwy3FAvlvQN368Vdl8NKvP6xLx6elefxSCcjaV87c6SNtkXTpOxFQb w8W7xqU8MXTnUTZ8EhqV14Y5wrhaST50++cfoenpv9YJ9/8nwlWl/Pv6JYQPrhPFin2u /RsTlKdmkkEv1H3V5+dcFE8eA0BXLgCKfPu4MzIW1X6qbYir7Fx0JmBVuEEcC7lgYkbO E4l0x8WDcAlt4DRBUuMvOFQ5UuQQgQKElYlmL1vYTde0v8QxorHbtXffhPhlgr4ABkHN 0DIA== 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=RyX1DY6Uvv7le7+gvCHN3nc8u0KoqGUCRhrraaCxYak=; b=DLRjq3B5iC5xpMtPlxI6T5J1Duj/2XeqzKuodTKwN1B0qsrNlQvPCkihMjrKZrqDcy R/yPe9VsZlaaMhzreJb2fz90NFg3Giko+rxuZAyaAXcJW/Xbbte4gvnSorl0Gm52BoV8 OpQH66F0rDl87yJE/QRopPvFrxUDu8WGLRgAKBBFQ+cMBo3bIyQf9ZggSunpEKpS03jf fz2TsLCr3PfNbN4Fdl/M8qJEtoyqOXhAbXmHFIdQPgJjPXFLN98g4g+nXiidYTGq3GqY R/yggi/YaCCNtOzGxq1jDG9rzD3q+jyxqe4/TOaObMkJZO7pw5BOpwX9z49jAwsvc6xH NF2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=bHTGox7T; 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 l18si2828878pfi.117.2019.05.03.09.07.01; Fri, 03 May 2019 09:07:17 -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=bHTGox7T; 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 S1728124AbfECPrB (ORCPT + 99 others); Fri, 3 May 2019 11:47:01 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38672 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727433AbfECPrB (ORCPT ); Fri, 3 May 2019 11:47:01 -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=RyX1DY6Uvv7le7+gvCHN3nc8u0KoqGUCRhrraaCxYak=; b=bHTGox7THPQe5esr1UhA68WT6 9smmfVhjMKUmiRzGDzceaytcSzkToYw72JIf+AjqMRLPVjra74kSDwnRrvticdF+brmMcs5/1fwRQ smuV30Gc/H+L++vRUUEnqKMdu3dzaonh2S+5LbCE96kdKcqxEfSn2daQAoC/VTmpgfLl/1NSQZO2r KRtU3b92XxlIODnh6a9xlUdXdYS5w/cNIhSrdaB9NaTJFmb+A6jw3aQOXdZyxObC+KH2qmbbczmMB VQ8gpkhZuzNULWV7AKd9c2DCdUEq9dbarYy7uWB8S5colf8Wvrza5s3PfIRbnGSmXO7G8V1EbLPrm WJh7S4xrg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMaOm-0000c5-5B; Fri, 03 May 2019 15:46:56 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id ED55F29ABBCF2; Fri, 3 May 2019 17:46:54 +0200 (CEST) Date: Fri, 3 May 2019 17:46:54 +0200 From: Peter Zijlstra To: Oleg Nesterov 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: <20190503154654.GE2606@hirez.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> <20190502100932.GA7323@redhat.com> <20190503141633.GB2606@hirez.programming.kicks-ass.net> <20190503153747.GC20802@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190503153747.GC20802@redhat.com> 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 Fri, May 03, 2019 at 05:37:48PM +0200, Oleg Nesterov wrote: > (And if we change this code to use wait_event(xchg(readers_block) == 0) we > can remove rw_sem altogether). That patch you just saw and didn't look at did just that. > The main problem is that this is sub-optimal. We can have a lot of readers > sleeping in __down_read() when percpu_down_write() succeeds, then after > percpu_down_write_non_owner() does up_write() they all will be woken just > to hang in readers_block(). Plus the new readers will need to pass the > lock-check-unlock-schedule path. Yes, that's gone. Still, write side locking on percpu-rwsem _should_ be relatively rare and is certainly not a fast path. > Peter, just in case... I see another patch from you but I need to run away > till Monday. n/p, enjoy the weekend!