Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2637965rdb; Tue, 12 Sep 2023 07:54:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtn4UGUapVeYOOHP9rBKivjO+HO/jVwFNsib6Lmvss6w2MDRy+oqrfypZhdfEj5mYaXJue X-Received: by 2002:a05:6870:f116:b0:1c8:bfd1:ecb8 with SMTP id k22-20020a056870f11600b001c8bfd1ecb8mr15901231oac.30.1694530440515; Tue, 12 Sep 2023 07:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694530440; cv=none; d=google.com; s=arc-20160816; b=qhHetSdAusszGqVBl9cqagSQKRkzQHk+hKB1QM6Qx+b6860zCJo2pwgIf/OTBWuPMu 8b+UUl4S6xGIb4FMP8tGtofbAkldQA+LpcozrC8zMaDmbrM5KCtyWrH01eTMEX9o0Ia1 Ir5YsVbrnJJij4c0eI+iBge2g/Lf/eWxt532xz0Zls3ZCy7G87hhEEKm3uTPP3/V5c/X Y4fIHDDVc1+JSwDyupWCO/JKzg6iGicNJxkd0ypKhoHN3YWAuK69Qy2PytF4r8IBa+++ EWixyO9Flt0HU1sQ5io3HJiEAQexPzI6fV1Pwbgo2BhxfFUndfTj0XarlEvA39GLnxqO ClIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uvRsZ8jHEZWSXxYqRgH5jVyNSga1PXW6GomFP+uyXv0=; fh=NxsdxGFwh+tDqqBdtRYMpHf3JxP4Nf7qvw2OiQ7NeUw=; b=haFn02EuIWHqlPKnUykBmxS6NL/gl3ArJLRxtSP4DdfN7lCR1AIM+j2GV54oFqkWn4 S2FSGjsLrauLQtcsmdSlssxm8dVjy+UW48cc820URtPhg6Z8fb8qrLQmYIvaH9FXWytD VQEfOh/iXHzQy6KjJPX7ya4ipkdaZZ8QknDHFn65xUs4JScqZ/O11NB9O8iRzWxkcqiJ /309iKK7rSeNwazWswv3NiifnqMtJ1gNsnDO+RZTDX2QvwtpjbP4TD2gykTk01F0fNmz wSLFoU7dbIQjnc9NRRuk45hBMxF1z3tdXgzbBNaWtWR/Ykpn4PqAIZI1Jq086YdotoVA bhxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=LE7GRKzG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id s9-20020a637709000000b005778dc6a841si2249250pgc.178.2023.09.12.07.54.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 07:54:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=LE7GRKzG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CEA0E81E3BA4; Tue, 12 Sep 2023 04:25:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234602AbjILLZS (ORCPT + 99 others); Tue, 12 Sep 2023 07:25:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234646AbjILLYf (ORCPT ); Tue, 12 Sep 2023 07:24:35 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C74F10E9 for ; Tue, 12 Sep 2023 04:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=uvRsZ8jHEZWSXxYqRgH5jVyNSga1PXW6GomFP+uyXv0=; b=LE7GRKzGPI1MnV/gY3EhWjOO91 aLoymo9B6RZS8P8hqjW4Z4bLF3AwWpxPfpkiPVSCnnSD08IEpUlHIHpSUQ0QQRu+iQpIQwr3mFub3 8ulGFqzXgEnvcY4fXO88v2HB7d6mmzqIDg14CgZPZfa1feh9rLSBEbiU3k5+jPrRriETg8b5O+ozF PJoSryjiPq+0/YU2vS+F9au9epIojDva9hQvJH4FRzMdQI1T1Wc5iVVXBTLhdevYay05+pRvbic9C ekCBuwYP2zTxjPMjJzRa3/eoEzNYNdoFcGnCAIOodf3MkV+X51b4pJ4JXqJRVdkRDm3W0CTGhR71K 6OyonlJw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qg1Ut-0063ms-37; Tue, 12 Sep 2023 11:24:04 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 15628300348; Tue, 12 Sep 2023 13:24:01 +0200 (CEST) Date: Tue, 12 Sep 2023 13:24:00 +0200 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, boqun.feng@gmail.com, bristot@redhat.com, bsegall@google.com, dietmar.eggemann@arm.com, jstultz@google.com, juri.lelli@redhat.com, longman@redhat.com, mgorman@suse.de, mingo@redhat.com, rostedt@goodmis.org, swood@redhat.com, vincent.guittot@linaro.org, vschneid@redhat.com, will@kernel.org Subject: Re: [PATCH v3 7/7] locking/rtmutex: Acquire the hb lock via trylock after wait-proxylock. Message-ID: <20230912112400.GG35261@noisy.programming.kicks-ass.net> References: <20230908162254.999499-1-bigeasy@linutronix.de> <20230908162254.999499-8-bigeasy@linutronix.de> <20230911141135.GB9098@noisy.programming.kicks-ass.net> <20230912111711.DHVKG-B4@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230912111711.DHVKG-B4@linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Sep 2023 04:25:20 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email On Tue, Sep 12, 2023 at 01:17:11PM +0200, Sebastian Andrzej Siewior wrote: > On 2023-09-11 16:11:35 [+0200], Peter Zijlstra wrote: > > Aside from this being just plain gross, this also destroys determinism > > of futex_pi, which completely defeats the purpose of the whole thing. > > No objections here. > > > Now.. the reason we need hb->lock at this point is to avoid the > > wake_futex_pi() -EAGAIN case. > > > > This happens when futex_top_waiter() and rt_mutex_top_waiter() state > > becomes inconsistent. The current rules are such that this inconsistency > > will not be observed. > > > > Notably the case that needs to be avoided is where futex_lock_pi() and > > futex_unlock_pi() interleave such that unlock will fail to observe a new > > waiter. > > > > *However* the case at hand is where a waiter is leaving, in this case > > what happens is that we'll fail to observe a waiter that is already > > gone, which is harmless afaict. > > Sounds harmless. I sure something will be pop up in a few years and we > will look back this ;) Oh absolutely, I already hate this... It's dangerous as heck, because if we ever do trip the race the other way around it will silently misbehave. However, compared to the other hack ... :-(