Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp75623rdb; Thu, 5 Oct 2023 17:36:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOmyU+oKdViQYz8k015DZdKWEHl3MCDv6ybvwXy7VIg2au0meWOwIaQdzJQZRS0dupAPnm X-Received: by 2002:a17:90a:1196:b0:262:f449:4497 with SMTP id e22-20020a17090a119600b00262f4494497mr6528223pja.2.1696552606411; Thu, 05 Oct 2023 17:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696552606; cv=none; d=google.com; s=arc-20160816; b=DTzIgE+r0L240/xX8uIjhRLTQWQV3vIMYxl4T/om1kIsTKvjdY+YHxm2ZrkinNEj4L AzFCJHufkUWS1Oz4WAeZxGslLWwSuwXyEOT4NoSlT5K2/zcQphHeSt1XVDIOjp7WRygY jpSv8js28lyap3ksNq6VvAD6DOI8i5xEOurSBEBG2r1Ebd59ghA0+0cZo0F/IJ9sMKXh /BzvxC9358WTHUmmu0uwJwTTN5sLNSXqWPStDLyo8uG+sMtT1Ci7kzWMExSSjbuSN9BS pu0ncPwi00bpkr6pqz13VdE9XyXskqvhD4k2GjZVn0RjOIEjh8l4DbKRrgyDrq4d3/35 6/zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tFgmfWnki8h/R7++p9q6A3/cLBb3+aKhbDTv7byzrlY=; fh=2ZQuJYNgMFZ7pXZg53o9+i3G3VmRZVxj/ewVCL/v1WA=; b=pTpSCsviOvQMECctRye7xPg+gdN0V2O9cs8M26X8/ACnQxZq+ONFdPdmcVmKygpbq6 uoDucOueyRhGNpz8eeh2YriofReMOg8oZm6p/8YWdRPh46kvY7NhHUf/R10BAxL9jocm Vk/oTelSGYTPkg1FiJqTxrXtJ8PDQWIMcHDukBrpoqNswJJ8vmzX3jmkxVcMDX7h8tL0 o0OFsBkRNcdjHwc1ca1E0yuFfrvoACV+s43tzXN4ife5Ans3eTVky7UClJUiYsRlfgYv gWs9+g/sUZx/FZFUG7JnNvEck9FANCt+d5NNJjhYuovDImstTx5AQ+UOrWRE7ans4ViC 9N1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="dFFZ1/YS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ci18-20020a17090afc9200b002774c98054csi2656993pjb.116.2023.10.05.17.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 17:36:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="dFFZ1/YS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 097AC8370823; Thu, 5 Oct 2023 17:36:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229574AbjJFAgn (ORCPT + 99 others); Thu, 5 Oct 2023 20:36:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbjJFAgl (ORCPT ); Thu, 5 Oct 2023 20:36:41 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADB33D8 for ; Thu, 5 Oct 2023 17:36:39 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-9b28dee4de8so58534466b.1 for ; Thu, 05 Oct 2023 17:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696552598; x=1697157398; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tFgmfWnki8h/R7++p9q6A3/cLBb3+aKhbDTv7byzrlY=; b=dFFZ1/YSxXyzgxxyjqkginlxOYt/SbTUW44x0Q0vFAIiHYKflRwH0CPoxFp12jD5Za PgU9E33neuNM/A81kU5KqIS4sW0shKIvu/LWEMwaHDAfueUCfqKLviwwIOY96OkdiUqz bTnxW+0Yh5shn+2beKXQa+Fv3LQU8AhcYqEKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696552598; x=1697157398; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tFgmfWnki8h/R7++p9q6A3/cLBb3+aKhbDTv7byzrlY=; b=l0plHvIuQGFcrmlqLRxvBBaXxJkE4nQfIPiC49P9DgxSxPqXqaIknZ2lxahmR3D3p2 g+qeX/EZfu5y+9iScJ3I6b3iHxMenNj6rpRqJY9QPWvOxij0Op+x075W67yQlYtk9kMN HxH4BTf7ppS9eboJvv+wARGOUktkm99SoZOUKsuvpZde8sfqZvyx+HETRSm/i8/rztwS BRFbZa1xxC5fssoBfbzOA+1s9/W0VjPTfhPG4n4lxsddUe1YymlSCvxEVt1k/ja5hSA9 OLRPwzNpBNy68Zy4AFxy7IlVFEdK+4ff7sVkFZ+0JafenCmG6ho+UGiARxGdM14Kxarg M2fQ== X-Gm-Message-State: AOJu0YzQ952VA3lG2dBAFmRZHeYRD0aW50Bkc1TdArHg3aNdHXXxHjSN kw+61mmlKAjBHt2sFUo5rdooTf+wvPG4H3LD/YoR8g== X-Received: by 2002:a17:906:10dd:b0:9a2:1e03:1570 with SMTP id v29-20020a17090610dd00b009a21e031570mr5391001ejv.0.1696552597840; Thu, 05 Oct 2023 17:36:37 -0700 (PDT) MIME-Version: 1.0 References: <20230531115839.089944915@infradead.org> <20230906131356.GG38741@noisy.programming.kicks-ass.net> <20231002184136.GA1539@noisy.programming.kicks-ass.net> <20231005120557.GA743@noisy.programming.kicks-ass.net> In-Reply-To: From: Youssef Esmat Date: Thu, 5 Oct 2023 19:36:26 -0500 Message-ID: Subject: Re: [PATCH 00/15] sched: EEVDF and latency-nice and/or slice-attr To: Peter Zijlstra Cc: Daniel Jordan , mingo@kernel.org, vincent.guittot@linaro.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, joel@joelfernandes.org, efault@gmx.de, tglx@linutronix.de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 05 Oct 2023 17:36:45 -0700 (PDT) On Thu, Oct 5, 2023 at 1:23=E2=80=AFPM Youssef Esmat wrote: > > On Thu, Oct 5, 2023 at 7:06=E2=80=AFAM Peter Zijlstra wrote: > > > > On Mon, Oct 02, 2023 at 08:41:36PM +0200, Peter Zijlstra wrote: > > > > > When mixing request sizes things become a little more interesting. > > > > > > Let me ponder this a little bit more. > > > > Using the attached program (I got *REALLY* fed up trying to draw these > > diagrams by hand), let us illustrate the difference between Earliest > > *Eligible* Virtual Deadline First and the one with the Eligible test > > taken out: EVDF. > > > > Specifically, the program was used with the following argument for > > EEVDF: > > > > ./eevdf -e "0,1024,6" -e "1,1024,2" -e "2,1024,18" -v 19 > > > > and with an additional '-n' for the EVDF column. > > > > > > > > As I wrote before; EVDF has worse lag bounds, but this is not > > insurmountable. The biggest problem that I can see is that of wakeup > > preemption. Currently we allow to preempt when 'current' has reached V > > (RUN_TO_PARITY in pick_eevdf()). > > > > With these rules, when EEVDF schedules C (our large slice task) at t=3D= 10 > > above, it is only a little behind C and can be reaily preempted after > > about 2 time units. > > > > However, EVDF will delay scheduling C until much later, see how A and B > > walk far ahead of V until t=3D36. Only when will we pick C. But this me= ans > > that we're firmly stuck with C for at least 11 time units. A newly > > placed task will be around V and will have no chance to preempt. > > > > Thank you for the detailed analysis! I am still in the process of > digesting everything. > I do have a quick question, this will only be the case if we adjust > C's runtime without adjusting nice value, correct? So it does not > currently apply to the submitted code where the only way to change the > deadline is to also change the nice value and thus how fast/slow > vruntime accumulates. In other words without the sched_runtime > patch[1] we should not run into this scenario, correct? > > [1] https://lore.kernel.org/lkml/20230915124354.416936110@noisy.programmi= ng.kicks-ass.net/ Sorry, to clarify, by "this" I meant "that we're firmly stuck with C for at least 11 time units". > > > That said, I do have me a patch to cure some of that: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/comm= it/?h=3Dsched/eevdf&id=3Dd7edbe431f31762e516f2730196f41322edcc621 > > > > That would allow a task with a shorter request time to preempt in spite > > of RUN_TO_PARITY. > > > > However, in this example V is only 2/3 of the way to C's deadline, but > > it we were to have many more tasks, you'll see V gets closer and closer > > to C's deadline and it will become harder and harder to place such that > > preemption becomes viable. > > > > Adding 4 more tasks: > > > > ./eevdf -e "0,1024,6" -e "1,1024,2" -e "2,1024,18" -v 19 -n -e "3,102= 4,2" -e "4,1024,2" -e "5,1024,2" -e "6,1024,2" > > > > t=3D92 V=3D16 > > A |----< > > B |< > > >C |----------------< > > D |< > > E |< > > F |< > > G |< > > |---------|-----*---|---------|---------|---- > > > > > > And I worry this will create very real latency spikes. > > > > That said; I do see not having the eligibility check can help. So I'm > > not opposed to having a sched_feat for this, but I would not want to > > default to EVDF.