Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2039334rwi; Sat, 15 Oct 2022 07:06:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM40kzJoUf7GCgdD1UpR8jiwiXd/gUrFzzblihjCc2ucNiQL7HO3DimrN643v6nHznI9qRYT X-Received: by 2002:a17:90b:1d0f:b0:20d:1ec3:f732 with SMTP id on15-20020a17090b1d0f00b0020d1ec3f732mr3581145pjb.84.1665842800059; Sat, 15 Oct 2022 07:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665842800; cv=none; d=google.com; s=arc-20160816; b=OWNf5TqVRtrrjN0FBPZs6Q7yzikKIlF0vFv/pNbwh+3lVeKPlQKuGBdPvC0wGKNKld W+f2ijbN6pDSSX/XgA+pV+ZNQmzHZOGeKdWS0C+vfkpUaEPayDqgL3/t2C31fxQNpliZ FG1vsqRSDB+zgSjfjwkS3jK2hTqDziKTblp5YEiy6I2cPG5ybruSA+lR/fk1aPgSS0W1 VA161o9YWck6fFJPpJL4SWT3ogLzlRIKFiwCVtb9QBfb5z38n+bUgWtzvg1SVJuIQwU2 K+siEpZ7fd2pO54fPYtMMXC8IWC6GZYH4Nl6G4giFLfbgcl01Ime5YrfCwwsCg5/JmRu aToA== 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=CnzUIp3qxALf1Dl1dPbjDjRUdaBdw43OChpkexPuzt8=; b=vKjFlRRuD006P8YwiD/zwuNVmrMr/yLa9y3r7+hNyfYf5A1u3YVOb0MlGdZYlpLz+7 GWOc5iFRU0tnrPqdsDrPkTSJGWv0gBvg2N2909IeKh3jOnukAYbND9ERFxTXYuO1PpZ5 MR9uAbIjinhRxC+owfzdF6ghmSKewG/iwBg3aaEbdxE5XILiarCdA9gP02mx6gDsBus6 +h8h8+n/v5BbmB+oGc4yGvNmiU1pe7h8Q6E1QjeP1xLmSsoVXGngHFlhMeGSLa1VsJmn rMPHCTO7R96ESrGEXYhrMO3X3NvfMjDNKo9mrtWJ1u9kp+yMv+rC92SXDDrcRcLUjUFj i8pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=mVo8bL7K; 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 bc10-20020a170902930a00b0017accae4d05si5780055plb.49.2022.10.15.07.06.26; Sat, 15 Oct 2022 07:06:40 -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=desiato.20200630 header.b=mVo8bL7K; 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 S229691AbiJONxr (ORCPT + 99 others); Sat, 15 Oct 2022 09:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbiJONxp (ORCPT ); Sat, 15 Oct 2022 09:53:45 -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 5834752E7F for ; Sat, 15 Oct 2022 06:53:43 -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=CnzUIp3qxALf1Dl1dPbjDjRUdaBdw43OChpkexPuzt8=; b=mVo8bL7K0RX1G2TKoODrfueYEO AwMiE74O871YdliJgvY0wjHAuLWH066+SMI4OPbUGmUAAGPu+PE0Hrp1CYHAAA433qbGFICTpQ1dx gRLLzzf8ftxj0bXZIKDQnsxNiby0xIYbsKtkkZRih/e89jvnKxsTOUAlPvx9WfyrfULk6vhdkvKeY j6yFQhSwlxVnueWbGk4nOGi6QFUPwqsYbIHIRKbyDfstOeyLpi8Ur+ueE4rQj8POUZaE8DAnXdRhv J8UcK6kJoFbjJ5QIjkXluqegwU0XM+fQvRmc9aFJukl3vf7zbqHPcAZPfqeTs4cAv20/ZBafZ2aNY SET8nW0g==; 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.94.2 #2 (Red Hat Linux)) id 1ojhbN-003gtx-Vc; Sat, 15 Oct 2022 13:53:22 +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 3EC61300023; Sat, 15 Oct 2022 15:53:20 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 11D3F201FF8A1; Sat, 15 Oct 2022 15:53:20 +0200 (CEST) Date: Sat, 15 Oct 2022 15:53:19 +0200 From: Peter Zijlstra To: Joel Fernandes Cc: Connor O'Brien , linux-kernel@vger.kernel.org, kernel-team@android.com, John Stultz , 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" , youssefesmat@google.com 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: 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 Wed, Oct 12, 2022 at 01:54:26AM +0000, Joel Fernandes wrote: > Here, for CFS, doesn't this mean that the ->vruntime of the blocked task does > not change while it is giving the owner a chance to run? > > So that feels like if the blocked task is on the left-most node of the cfs > rbtree, then it will always proxy to the owner while not letting other > unrelated CFS tasks to run. That sounds like a breakage of fairness. > > Or did I miss something? So CFS will pick the leftmost task, if it happens to be the lock owner, it will run as normal, owner time will advance. When owner time is advanced enough to not be elegible anymore, it is likely a blocked task is selected, at which time we'll advance it's vruntime. All this repeats until the whole block chain has advanced enough to make the owner elegible again and the whole thing repeats. From this it is easy to see that the critical secion executes with the direct sum of the blockchain as a whole (all of them will have donated their relative time to make the owner elegible again) -- provided the critical section is of course long enough for this to matter (or it's owner's weight small enough etc..).