Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp632197rwd; Thu, 8 Jun 2023 05:54:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7nZGMfQ6oW743LJoTEcGshCvG6TK8CnJwl5qx7YjrG8+voAg367I4twoF6/QjZJ0HYaABF X-Received: by 2002:a05:6a00:1254:b0:64f:35c8:8584 with SMTP id u20-20020a056a00125400b0064f35c88584mr10371644pfi.18.1686228870917; Thu, 08 Jun 2023 05:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686228870; cv=none; d=google.com; s=arc-20160816; b=ldBA/sF8O8QI2Hjtc9wamQlWnxFAEEBI4uYP/zOGbSP58dRlQ/yh5Pqscy55/AEKtC x8an0MEZC+u0gnzVFEru5fdEWzCSf0S1x6Es3F5kAM3RQrFEFg28UbSHGqwilh/vm4Hk 01r4KslsEgbKrvjjK65NWKmv2x3/hYyO7wXz6lbmxB+UaprSqxeF7KimIcm5zcPELq60 fPOjPrTmXRr6qXWGWyqDpB8mR0sGh4sjStsTGaYdPS4NvAOqFpaX4mrQPyXf4OZ1KUet DJlpQbQTh8ZGwpz8k1+Go1pTEvTtpPTCM51asAGjbRukWzNAz93b7vZ7cpQmj4RFr1KZ U8fw== 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=1FJ/mNTB17zfJ2aN7TDhiCCKZAgH2w1JIx+mCkoNx/U=; b=N6vBDEmJi58p5o+SU14ccBFhzlNeu33WFgkspZQC0u0JtiFcB7ZK54LnuB2GjUGHE/ kWc6POXeC9Wc5+NNs4tZHH3654vGzooOs3h3ylhUKDX60qatoqutcAQb5pkL0nJjIdZe dst/cA6lZ0PaOuv32EIE8ZHWYWGxIde5e7VQ+c27veYaUkdZ7k5w8ies2cDXKYAeGtnR vjZxBthRFHL0gfTcCuvLpc5fyjKQmM6CId7DiP1Z739hcoR1RhnAq8ZbcAZyvhGJ8gp1 9yViTgbpI8Db+Wa+T/Ul3d91y7OaNKqUXlRNdQzKKxbowH5bohvfTJ2H1nmonIyCiXD+ PppA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=UjAEgZwS; 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 a13-20020a621a0d000000b0064cf289a327si820049pfa.129.2023.06.08.05.54.17; Thu, 08 Jun 2023 05:54:30 -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=UjAEgZwS; 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 S235947AbjFHMqD (ORCPT + 99 others); Thu, 8 Jun 2023 08:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236372AbjFHMp3 (ORCPT ); Thu, 8 Jun 2023 08:45:29 -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 633B626B1 for ; Thu, 8 Jun 2023 05:45:28 -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=1FJ/mNTB17zfJ2aN7TDhiCCKZAgH2w1JIx+mCkoNx/U=; b=UjAEgZwSFene4LA1gOBpEnmv6v +WEBmvk46fXlN8vIhvKfDsNwp2M7tOnVeLXh/9NnhPIEdIrhTkRkylLbrMv20J+gKeSr6Bxz9QZHx JVcg1Sk80LV1Qf/h6+REJVWAmQ4aquyBmz+SLGerxgLbmooXSHSqm2om9ZJ2s0we5T9V4/qCLaluj Q7LAQsVfRbRtP2Uw0AmrDsXl0iPRQyzsuzj6s2YKcMQtiaH61841kfNa54nVEfJ1Dm7/cl4+TibeC Ac1YQ581PlzDj/O1uomAX0jnIuOeSg8P9JiOkx8+Ja4qZuEdWZ0O2pbgACiyNsIsiqkrN9rl1SXbV jTtGm1KA==; 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 1q7F0N-006DWc-0S; Thu, 08 Jun 2023 12:44:43 +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 BEF0F300274; Thu, 8 Jun 2023 14:44:40 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A4A2F245A87E7; Thu, 8 Jun 2023 14:44:40 +0200 (CEST) Date: Thu, 8 Jun 2023 14:44:40 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, corbet@lwn.net, qyousef@layalina.io, chris.hyser@oracle.com, patrick.bellasi@matbug.net, pjt@google.com, pavel@ucw.cz, qperret@google.com, tim.c.chen@linux.intel.com, joshdon@google.com, timj@gnu.org, kprateek.nayak@amd.com, yu.c.chen@intel.com, youssefesmat@chromium.org, joel@joelfernandes.org, efault@gmx.de, tglx@linutronix.de Subject: Re: [RFC][PATCH 13/15] sched/fair: Implement latency-nice Message-ID: <20230608124440.GB1002251@hirez.programming.kicks-ass.net> References: <20230531115839.089944915@infradead.org> <20230531124604.477939524@infradead.org> <20230608103458.GI998233@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230608103458.GI998233@hirez.programming.kicks-ass.net> 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,T_SCC_BODY_TEXT_LINE 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 Thu, Jun 08, 2023 at 12:34:58PM +0200, Peter Zijlstra wrote: > > Then asking for a request shorter than the tick also means that > > scheduler must enqueue a new request (on behalf of the task) during > > the tick and evaluate if the task is still the one to be scheduled > > now. > > If there is no 'interrupt', we won't update time and the scheduler can't > do anything -- as you well know. The paper only requires (and we > slightly violate this) to push forward the deadline. See the comment > with update_deadline(). > > Much like pure EDF without a combined CBS. > > > So similarly to q, the request size r should be at least a tick > > in order to reevaluate which task will run next after the end of a > > request. In fact, the real limit is : r/wi >= tick/(Sum wj) > > > We can always not follow these assumptions made in the publication but > > I wonder how we can then rely on its theorems and corollaries > > Again, I'm not entirely following, the corollaries take r_i < q into > account, that's where the max(rmax, q) term comes from. > > You're right in that r_i < q does not behave 'right', but it doesn't > invalidate the results. Note that if a task overshoots, it will build of > significant negative lag (right side of the tree) and won't be eligible > for it's next actual period. This 'hole' in the schedule is then used to > make up for the extra time it used previously. So notably, if your task *does* behave correctly and does not consume the full request, then it will not build up (large) negative lag and wakeup-preemption can make it go quickly on the next period. This is where that FUDGE hack comes in, except I got it wrong, I think it needs to be something like: if (delta / W >= vslice) { se->vlag += vslice if (se->vlag > 0) se->vlag = 0; } To ensure it can't gain time. It's still a gruesome hack, but at least is shouldn't be able to game the system.