Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1454269pxb; Fri, 10 Sep 2021 06:21:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl2XQ8/wb7rxnrp/SDtBjCnON2twNhUehTMY9r0JfraHThvY7NOHs5G2rR9/AVyK5DUd4s X-Received: by 2002:aa7:c311:: with SMTP id l17mr8939828edq.320.1631280080430; Fri, 10 Sep 2021 06:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631280080; cv=none; d=google.com; s=arc-20160816; b=wHvy7EY/Vrv1Z79ivva3hu0zVW/QS0xv9FW9D7GBsfHfxNVIRXZC5QExNyrQkR5Wce 4hkV36C6u9pS1CDGgksIJHy/fHm2BCPFe9Bbu1a/2dXebw0XtOfHAuygCIj90zlCNG/i gKo/nSAS2AbZdOTr1CnxaGQUTj5DIXrcQaeID/0rcqFRQCDRbn/6AZUx+hti8HZ1JW9P Ra2eRn9mb+Nh8FB6J5/zSSAWbuPDjivX0tKIT6bqVEtOhHbTTinoMC4Bk/p3NIWGZQDn Kicmk53A0jbJkDP5iVBgcN3J2Uvv76Wt88LRCoO+wmy6qCXwqQTf/BNS+ofINt/M0gXd PdMg== 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=ninElOyv81dMVidL5ufjaZyKTFmzPaIwU+OoWpq1OOg=; b=IUobuKOszRPuNusW6P4kZUEk3uHbDkjgzbplwigLQKaYN+mALtiPaw0GE5PsfIOjrP xd8hKlCL45wVYSCJxP/ZfH4qnFSGYklGBSM0n9zVsmpJr9RiZ6rxCbtImC3xJM4xqtAB ht2upTwrkQxAbOz4idnHMztFUC0H1x9GJNwBjGFcbdw/JGTadIyQZGLdM/8fo2vXq944 Sq2idSubVuXkspYxX4RV8kdcpevVf0YJ1/I3d5EACKQR2Zl8gqzWze4XvXz+gw3b0EK8 ir0acACqP0FQ6KkfM68zoeYShkPbPJaRrk3yBrBNm9+i0UDhN1/XRm0vFQoVOzV1cr5G MFBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FO+tHfue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q17si5733319edd.616.2021.09.10.06.20.56; Fri, 10 Sep 2021 06:21:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FO+tHfue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233582AbhIJNUe (ORCPT + 99 others); Fri, 10 Sep 2021 09:20:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232804AbhIJNUS (ORCPT ); Fri, 10 Sep 2021 09:20:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DD53C061574 for ; Fri, 10 Sep 2021 06:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=ninElOyv81dMVidL5ufjaZyKTFmzPaIwU+OoWpq1OOg=; b=FO+tHfueTJF3RSFawxG4/G5rGB Wq8V1O12TjM6OEKiEwWqxOlR73xTN8p986jwFfYGSmODuFFNg5lk8CFxD8oq7LMN9Z2Y94m/Gn7Ns rnlGrqUDGzELw+AOpSz+rZCWDOyC3Pr30RP5FToYPEGx7yTZwibSf12PNbAV7cOfWAL+sZgJVfx2I G5vKJxeVsyN2YZlX/dC+kxXGJ89TqQFH6y+qfMqJ/fJHN3ChTcOfmp0u8kng558gZl6ufoKAP3OV7 T56vK/vfnyKtezZ6uoHFtYYP9pa9WEcGCW2GmqlrrIDNRFET0cxy5j8Q9SN90ZgPafB4L0qZCeH5v obEhWm0Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOgOw-00B2DC-Fa; Fri, 10 Sep 2021 13:17:19 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id C5AAB300047; Fri, 10 Sep 2021 15:17:04 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A75042C1B51C5; Fri, 10 Sep 2021 15:17:04 +0200 (CEST) Date: Fri, 10 Sep 2021 15:17:04 +0200 From: Peter Zijlstra To: Will Deacon Cc: tglx@linutronix.de, boqun.feng@gmail.com, linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli , Steven Rostedt , Davidlohr Bueso , Waiman Long , Sebastian Andrzej Siewior , Mike Galbraith , Daniel Bristot de Oliveira Subject: Re: [PATCH 1/4] sched/wakeup: Strengthen current_save_and_set_rtlock_wait_state() Message-ID: References: <20210909105915.757320973@infradead.org> <20210909110203.767330253@infradead.org> <20210909134524.GB9722@willie-the-truck> <20210910125658.GA1454@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210910125658.GA1454@willie-the-truck> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021 at 01:57:26PM +0100, Will Deacon wrote: > On Thu, Sep 09, 2021 at 04:27:46PM +0200, Peter Zijlstra wrote: > > Moo yes, so the earlier changelog I wrote was something like: > > > > current_save_and_set_rtlock_wait_state(); > > for (;;) { > > if (try_lock()) > > break; > > > > raw_spin_unlock_irq(&lock->wait_lock); > > if (!cond) > > schedule(); > > raw_spin_lock_irq(&lock->wait_lock); > > > > set_current_state(TASK_RTLOCK_WAIT); > > } > > current_restore_rtlock_saved_state(); > > > > which is more what the code looks like before these patches, and in that > > case the @cond load can be lifted before __state. > > Ah, so that makes more sense, thanks. I can't see how the try_lock() could > be reordered though, as it's going to have to do an atomic rmw. OK, lemme go update the Changelog and make it __flags for bigeasy :-)