Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2358020rdb; Tue, 10 Oct 2023 01:09:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGP98RDkjSxqxWsSnoYOPfK3YolJQrFSHiEF0RzcmyOs2eOXf5vZ7JEcXkqarYDpG5EpShG X-Received: by 2002:a05:6a20:42a2:b0:15a:290:d83d with SMTP id o34-20020a056a2042a200b0015a0290d83dmr18080868pzj.41.1696925373466; Tue, 10 Oct 2023 01:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696925373; cv=none; d=google.com; s=arc-20160816; b=JMN2cTccBZsEVntINlR20yHBOp4SJrG9thSnpKDkOjZF+Wk3KKSIIIfCluYGtIGwvM 3hMJR66UYJoerNCSDfiJt7cV+UzkfZYcnLOKo6JG1RCR865WxLeNvjasButU/cfTsAUE KFRbOG51W0Ohger+YU2tCwySTVwMlvG7Iu3G97fNjW6A6T7RXlML7I+SDs1f4iQk/j+T pPCaubhb1ZhrczESKVgd7LjDzpxEoZ/UdoWqplo3LmHtfbMafUs+mtQZQHPU5RIG/rBw KZlwwXQGV7G3C8g+/utBSrgZqQFsPNsaCZ69FdrSvKV4+B3UD5XGaBH90dqjjfiPnMuV U2tA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Uf08qN4MMqaXgQNdZMKbX8K1uA7l52yp3xz4+JLzueI=; fh=p+3SfeoXWgG/1gOBDlxvHpzXOEAFeDYhq1lLhLIPRnM=; b=EeLE/VdipmEo1JU7b+16QfyNIEiVojjZxvCDOnzfEdR9l7dplu0ueBFI1cAENTmn6F dZ5HuqrF6tHVG0ZOpisn8cMokQmxWlJjsaHc21wX6m68tkb88DUQwirOLlcQoVU4crhX d/6pAfz0fAEN2a9xGFepcPh3ZptcjhPI7h/3GboYYDHKE9uVTlXB/N+zYPvKdvGFJ7wp ATqsbKoRGtwNtEw+amwCSjT0Ll13GqqkGoE0Ntzd2esmD5NQJTdUBmocdUYQEaD76TJQ S07I7Ru/L3IN86j6GjYXAvjQDXzHQDvj7p2vacAZ82XI09PhMpNOQBq46rA5ifRC6ssK 9f7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=DBkdKnY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id p2-20020a056a000b4200b006901504b6a3si5503703pfo.153.2023.10.10.01.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 01:09:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=DBkdKnY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 31C2C82339A0; Tue, 10 Oct 2023 01:09:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234710AbjJJIJW (ORCPT + 99 others); Tue, 10 Oct 2023 04:09:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234630AbjJJIJU (ORCPT ); Tue, 10 Oct 2023 04:09:20 -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 B4595CC for ; Tue, 10 Oct 2023 01:09:17 -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-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=Uf08qN4MMqaXgQNdZMKbX8K1uA7l52yp3xz4+JLzueI=; b=DBkdKnY+Z18SGA7W+kr+zAgOTf YS1x3wmg5SbBdfgAyAHxGGMzV3CUHMlrRYa/iHk61RPpF6JJfif1AAzFv6e5Mo+6823HKUtMHavXq FPbtGpsa1QK6/+GjUxjfIJPCLxKLKruSnbDALpf5ifItlMRbAorsTTm1NA9t6bFwNf3ggxTQetwPe qRFzlbbv/W324aeJJWHzvXbsoeumqIPdCM0SLb2h+/aaEJxNIaUOW+UPm5wN72r7nufyzHrUHc2nP 2epQSmy0TuFv86omX9RHlm3PunEzAJyij96rJF+toJvaIYjJiciSMOj+gsinPIf5E7FrGE/XIm8vp si7DuDLw==; 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 1qq7nD-00GhNQ-0i; Tue, 10 Oct 2023 08:08:43 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 52183300392; Tue, 10 Oct 2023 10:08:40 +0200 (CEST) Date: Tue, 10 Oct 2023 10:08:40 +0200 From: Peter Zijlstra To: Youssef Esmat 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 Subject: Re: [PATCH 00/15] sched: EEVDF and latency-nice and/or slice-attr Message-ID: <20231010080840.GC377@noisy.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 01:09:31 -0700 (PDT) X-Spam-Level: ** On Thu, Oct 05, 2023 at 01:23:14PM -0500, Youssef Esmat wrote: > On Thu, Oct 5, 2023 at 7:06 AM Peter Zijlstra wrote: > > BAaaBCccccccccBBBAaaBBBAaaBB BBAaaBBBAaaBBBAaaBCccccccccB > > > > > > > > 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=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=36. Only when will we pick C. But this means > > 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.programming.kicks-ass.net/ Much harder to run into it, but you can still hit it using nice. d_i = v_i + r_i / w_i So for very light tasks, the effective v_deadline goes out lots. And as I wrote yesterday, by delaying scheduling (far) past 0-lag you effectively open up a denial of service window, since new tasks are placed around 0-lag. Now, nobody will likely care much if very light tasks get horrific treatment, but still, it's there.