Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2118900rwi; Sat, 15 Oct 2022 08:12:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6osG5GJ9YS80yAgHv48dFGuHoK5ey99qd97RUtdbWpB05Yi/dQKQHozAv2lYPpOId84j9f X-Received: by 2002:a05:6402:4505:b0:451:1551:7b14 with SMTP id ez5-20020a056402450500b0045115517b14mr2674567edb.300.1665846775883; Sat, 15 Oct 2022 08:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846775; cv=none; d=google.com; s=arc-20160816; b=CXPmf+XXZyLnWU4hkHVxaK5ewog32WC/EoYqNHt2BkLYrk67F2WEOHu8q2YVvgaFsg 17Bg0S4+DnsJgO8P5I1sv09D0gCf2Jj9WmCjewnobwGechgTjQ8ee04GMOQSw0fRmNEX pb5tdUoj/pbCM2HxGwR2bP2D7zPOw0koDWn+v7GfZL2Q4ALLv+SXr/snNEznAaUFuLGW rjduzqcFiIJ3e7QiLRidzgYNjk1hNBHole8ZokQUXPuZkBWF05DMmwdxUJOTD7afCoC7 WQo4PGQS3AzS32iJer2NVTZmvpyq9hd9/wQnC8ypm1mt55J7giZrSx0k6CMEafi3ZU1F vgLg== 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=AjipCgEKRcu/TILN4c/hLLWN721c5fXSxTf3IC4QIqs=; b=IxXqXqEfePoO/ye64Tud+DwBlKXxahDVKNkeotTP0WaLsq2Cj9Kx08cyj9rhF61dwT UXK/7mK+T/XXG7i09ANbzXzicUptDqsmcI8kgNjydA/kewZ8c+sIiwZkOoOe7aQcueLm /fOH1RxO2ZidS88LgGT56lSFO+DellIWeRBoCnjCluhc0u0+knVp6Vd2v4sPtnjWmF+n YX7ZE5huDf/iPpZeHBUpq45xLXqcPw/JxtBJw297VaWXni/IvCeA39zymA/79nULMrcF mYPWhStIC+mhS+OLbYfIG9UScQg+rQFMPu8cc3r2R+/SeSLjKy/wUnW27c09490WaVli 4Kqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XVFd1LIg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a17090630ce00b00782da4ff18dsi4520924ejb.668.2022.10.15.08.12.30; Sat, 15 Oct 2022 08:12:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XVFd1LIg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbiJOPIg (ORCPT + 99 others); Sat, 15 Oct 2022 11:08:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbiJOPIe (ORCPT ); Sat, 15 Oct 2022 11:08:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDA73537D7 for ; Sat, 15 Oct 2022 08:08:32 -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=AjipCgEKRcu/TILN4c/hLLWN721c5fXSxTf3IC4QIqs=; b=XVFd1LIgp7Se11/qy/RknThCaK /9+jleaoH+zS/S7yLLd0w/zDEgAN6p0MWf6+qhJgGul9BZDDGoDdvL/MtUPJlGz/USESi+VFIMGYF mYlqH4EXN1Rnv3jnIZe7zrm2QI6KyJ9xIZRtjPUMgio4M6hBS2FAtnD1Lw9pGLzkisLI5D2bAE+Sw /vZggwxK8vE7LH9XgO5IyD3x+MJ6wrmpX98dAY5cUKd+qVhzKZZNr74WCuwBHvq3eUbb0qukCn+Km xYuvvxj/uqqBv15XFuGEZI0k4xUVLSp/KYSTEpidzrKjms3E5m0o/1WzwVtuU/s3YIuEJd2TSepqd ROWok7zQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojilw-008S2c-QD; Sat, 15 Oct 2022 15:08:20 +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 (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 4EB7C30015F; Sat, 15 Oct 2022 17:08:14 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3879F201FD678; Sat, 15 Oct 2022 17:08:14 +0200 (CEST) Date: Sat, 15 Oct 2022 17:08:14 +0200 From: Peter Zijlstra To: Connor O'Brien Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, John Stultz , Joel Fernandes , Qais Yousef , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Will Deacon , Waiman Long , Boqun Feng , "Paul E . McKenney" Subject: Re: [RFC PATCH 07/11] sched: Add proxy execution Message-ID: References: <20221003214501.2050087-1-connoro@google.com> <20221003214501.2050087-8-connoro@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221003214501.2050087-8-connoro@google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 03, 2022 at 09:44:57PM +0000, Connor O'Brien wrote: > @@ -965,7 +1026,10 @@ static noinline void __sched __mutex_unlock_slowpath(struct mutex *lock, unsigne > if (owner & MUTEX_FLAG_HANDOFF) > __mutex_handoff(lock, next); > > - preempt_disable(); > + preempt_disable(); /* XXX connoro: why disable preemption here? */ > +#ifdef CONFIG_PROXY_EXEC > + raw_spin_unlock(¤t->blocked_lock); > +#endif > raw_spin_unlock_irqrestore(&lock->wait_lock, flags); Because if we wouldn't have preemption disabled it would preempt here, before the wakeup: > wake_up_q(&wake_q); And you'd be stuck with a priority inversion.