Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp370472rdb; Thu, 5 Oct 2023 08:16:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEenJWIw/PGSV/TOfzayCIGp5tId9TM6xinuYTQurtJ6MfAOfBSAz5XyHtQgVbkzrOL1KNj X-Received: by 2002:a05:6602:379b:b0:79f:9574:b936 with SMTP id be27-20020a056602379b00b0079f9574b936mr6311782iob.13.1696518997336; Thu, 05 Oct 2023 08:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696518997; cv=none; d=google.com; s=arc-20160816; b=1JE+3A0GBa9SROHaXxGLZMjL+s3WAAMm3CKDItebjFmnkRcuZjYe6eAfpruTqNxiPW N1QR4q6KL3t/Mj2nQa8M/6HghvFKFwxycTZfT0qpc7JpCB3QTohro+wBs8WuDGBpLTDC R1GwTASB7tlMzyvDuaMGBogZu+D8f3PRDXqVL7Lg9EJH/AGWuk6vmBCB3/6mFIFz7QiM fslbFT1kshtTsM2v3c+mm7YvP7hc45OfJITobhbSFBX4ETUomQvgaUk+bMAs5OwW7IaG RnCvw9Ndgc6RDSURlxpXmW1SlRa0saPtbzZI/mZ2rTsEx94VgbdgRzpQ1yyxNUkZO8kY c7JA== 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=A3dD49hcyp5oU6Y79kzfv064lAkg1W7ksDH4T/U5iJ8=; fh=p+3SfeoXWgG/1gOBDlxvHpzXOEAFeDYhq1lLhLIPRnM=; b=MHCIX/X0s3IbjmXh5ONqx8XFH525DQ8U6D8YMNNUN4/7WXEdqoAZlBDlSkDFUzJ7u1 7xhJ2er4OpnAqQjeRTrjhXNurReohEHBe8NsKi6hkwpufnsYl/vxJSTSRrbrQt2cQzgV MJQESERvrnQG9S3o2swMORw/ckvjZ33Ek7jNvj49qHLGLAxB3nQgkgI+A1LZFxmTe+hp AIquyjv//B3E9LzruYgjYW07WXNOpXZZkXCyWHxYCHNWVEOSIv+Xzy7DY6WsfHAybMO9 Caj0a8HFmCGPvgdQVcC+mt77d1fvz0IP4n4XkMfkGc/jeVhyWMrsBvu3yNk1sJT/bhxO H9Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=W3Vistp0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id z70-20020a633349000000b0058978136247si783033pgz.483.2023.10.05.08.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 08:16:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=W3Vistp0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 376C883746A3; Thu, 5 Oct 2023 08:16:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232031AbjJEPQG (ORCPT + 99 others); Thu, 5 Oct 2023 11:16:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbjJEPPK (ORCPT ); Thu, 5 Oct 2023 11:15:10 -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 E03B665BF for ; Thu, 5 Oct 2023 07:43:29 -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=A3dD49hcyp5oU6Y79kzfv064lAkg1W7ksDH4T/U5iJ8=; b=W3Vistp0YedPgkRP2WHTP846Mh 0BeGZI/5OiqAl04tE/7St7RaWoY/TYIJ4DWK42MAee28XUtkRFLzVA1A6Yin9whHEYe0UR0lZrHj3 80DCalOudbJwPQ+44zCXmZHD2Fxg38oonzhgBOacq/eCkqRKfYF2/CXg7j6hADZ/zyK3mWgkFQUHF xNXDlrL2uCA8LqBMPBnUrXcZJT8irVCkJ8QjhShLMV9WpZEPqxI1+qnIg3arwBFrF5rEoeupZvKRM CnQViVfWISEOw7KQ0YZc2qB6Xhz3MlMVEIKslM2G0XL2pvjDtFm8jw4nj/Y3TBAi3QRjGogstZFMb kIBsqCCw==; 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 1qoPZ1-00BmDr-39; Thu, 05 Oct 2023 14:42:57 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 1AACA300451; Thu, 5 Oct 2023 16:42:57 +0200 (CEST) Date: Thu, 5 Oct 2023 16:42:57 +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: <20231005144257.GC743@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> <20231005141408.GB743@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231005141408.GB743@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 05 Oct 2023 08:16:34 -0700 (PDT) On Thu, Oct 05, 2023 at 04:14:08PM +0200, Peter Zijlstra wrote: > --- eevdf.c.orig 2023-10-05 16:11:35.821114320 +0200 > +++ eevdf.c 2023-10-05 16:08:38.387080327 +0200 > @@ -7,6 +7,7 @@ > #include > > bool eligible = true; > +bool bias = false; > unsigned long V_lim = 20; > > struct entity { > @@ -79,16 +80,17 @@ > > struct entity *pick_entity(int nr, struct entity *es) > { > - unsigned long W = 0, V = 0; > + unsigned long W = 0, V = 0, R = 0; > struct entity *e = NULL; > > for (int i = 0; i < nr; i++) { > V += es[i].weight * es[i].vruntime; > + R += es[i].request; * 1024 Also, average seems too much, one large value lifts it too easily. Need to come up with something better :/ > W += es[i].weight; > } > > for (int i = 0; i < nr; i++) { > - if (eligible && W*es[i].vruntime > V) > + if (eligible && W*es[i].vruntime > V + (bias * R)) > continue; > > if (!e || es[i].vdeadline < e->vdeadline) > @@ -169,10 +171,14 @@ > > const int N = sizeof(es) / sizeof(es[0]); > > - while ((opt = getopt(argc, argv, "nv:e:")) != -1) { > + while ((opt = getopt(argc, argv, "bnv:e:")) != -1) { > unsigned int v,w,r; > > switch (opt) { > + case 'b': > + bias = true; > + break; > + > case 'n': > eligible = false; > break;