Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1928447rdg; Sun, 15 Oct 2023 03:55:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJZecadBovS7VhmbEFP1qSo2wks49MDEa93yNOe+K4i7stpciLuVcPL68utyDWEqWX6OqN X-Received: by 2002:a05:6871:1d2:b0:1d0:e372:6c2d with SMTP id q18-20020a05687101d200b001d0e3726c2dmr36203550oad.0.1697367314789; Sun, 15 Oct 2023 03:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697367314; cv=none; d=google.com; s=arc-20160816; b=0Du34UlfwMYjGqk+n+6pEQpdyitAckptiy6LgN2zEPNasM3HRzq34M1KVWgMYiWszJ 7DCxk3QaRs+b4EBjY3XmLvZ+/7Fr5fFfWHdP88Zk/HIkk5W/yeWeDVPI7BR1VaUBozf3 zPA7+jc+STRUjEyVGOKi0BVHRr2WllliLB3FCyl3uzWZfVtD3l/27ARNxBx/epo1g37j goVX6DvY8VHBsc4cfKRvJhzKKE1mkkeVckmzFrkLGDy1hZJ/cqVnfsMLekMbb0ZADVY/ AWtCGXngp0UcxghSUiO9gcOWGU0SN35vq+cGN/ndZc0+wxMm4oxgYVe3XG1UkTf+ZyBx qadQ== 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=OMXIfKJtP8Zr21SLnkQc019y62ZA5kcIt5+lgRa0zu0=; fh=VqW4fSsqervtw9KrBxuM/K3TH8m5Faq7v93RvLJCm4E=; b=zHAAvw5BI3clKvVReqk7rL1efXUIlDEsQyI13V6AU1T8ClQtaDv3O5PIN3hyLLoqFt TY0/YsjiIHcUyl1BMYua7lCPKc2VhgmZBm0Glfsf65H0JlH9bP6nWzCRWtHxRCfsYmyn XJL2i3Y4RjyTNjfuSxbbyesl0llWn9fPQa283+bTwGKUefydcjU/yLAXFi4gTIUlZkKk EyjGO020VZuqWsXYEstr/VdfmrEg3TAw+0KeA9br9auO+70x4q9JL8gUVJu2CYXm8w7S qTla+4kY+iBS0QtsM0XXy81OFoGG5fPDeZ8mI+bBloKMlfOQ4eonwiNw1PZb/eo/Do7/ q+tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=I8e6tOtk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id l10-20020a63570a000000b00578d0d070f4si8518372pgb.844.2023.10.15.03.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 03:55:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=I8e6tOtk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id DFA3D8052591; Sun, 15 Oct 2023 03:55:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229573AbjJOKpx (ORCPT + 99 others); Sun, 15 Oct 2023 06:45:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjJOKpx (ORCPT ); Sun, 15 Oct 2023 06:45:53 -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 F295FA3 for ; Sun, 15 Oct 2023 03:45:50 -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=OMXIfKJtP8Zr21SLnkQc019y62ZA5kcIt5+lgRa0zu0=; b=I8e6tOtk0j4vCBAqKN82Uj3a/T 3h+19CT7hkYdSa08ZGlG7qpiMGh1+WSpRZk3WInvKorKLQ3IxHFaLo8duLcQ4hz73Jj1jjv7mdpkZ xYGZoqeeSAbOnkzy2PmJjcjttWhQyBVeAkMNJ+TIfT0TCjGmR0uxOsJGzrh6kHSOCOPZHl+o/z1zz REP80ngeSHBFNFDICygeoJHWm+bDAzyn1+tr7tTs3zQ3B4jGZvn4/0Udn9qReQ+hqSM3C41kFUoHC 9KEopG8XuQxD20SG5Jv9qrHmtQROUFyDoUoFQtyxJuIkX1DI8e5qFgI95JbBH2ghA2Iku+mvQd+qg E7l2pVjQ==; 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 1qrybj-004nqf-2a; Sun, 15 Oct 2023 10:44:29 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id DAB42300513; Sun, 15 Oct 2023 12:44:28 +0200 (CEST) Date: Sun, 15 Oct 2023 12:44:28 +0200 From: Peter Zijlstra To: Youssef Esmat Cc: LKML , bsegall@google.com, mingo@kernel.org, vincent.guittot@linaro.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, 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, wuyun.abel@bytedance.com Subject: Re: [PATCH] sched/eevdf: Toggle eligibility through sched_feat Message-ID: <20231015104428.GA11840@noisy.programming.kicks-ass.net> References: <20231013030213.2472697-1-youssefesmat@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231013030213.2472697-1-youssefesmat@chromium.org> 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Sun, 15 Oct 2023 03:55:12 -0700 (PDT) On Thu, Oct 12, 2023 at 10:02:13PM -0500, Youssef Esmat wrote: > Interactive workloads see performance gains by disabling eligibility > checks (EEVDF->EVDF). Disabling the checks reduces the number of > context switches and delays less important work (higher deadlines/nice > values) in favor of more important work (lower deadlines/nice values). > > That said, that can add large latencies for some work loads and as the > default is eligibility on, but allowing it to be turned off when > beneficial. > > Signed-off-by: Youssef Esmat > Link: https://lore.kernel.org/lkml/CA+q576MS0-MV1Oy-eecvmYpvNT3tqxD8syzrpxQ-Zk310hvRbw@mail.gmail.com/ > --- > kernel/sched/fair.c | 3 +++ > kernel/sched/features.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index a751e552f253..16106da5a354 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -728,6 +728,9 @@ int entity_eligible(struct cfs_rq *cfs_rq, struct sched_entity *se) > s64 avg = cfs_rq->avg_vruntime; > long load = cfs_rq->avg_load; > > + if (!sched_feat(ENFORCE_ELIGIBILITY)) > + return 1; > + > if (curr && curr->on_rq) { > unsigned long weight = scale_load_down(curr->load.weight); > Right.. could you pretty please try: git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/eevdf as of yesterday or so. It defaults to (EEVDF relevant features): SCHED_FEAT(PLACE_LAG, true) SCHED_FEAT(PLACE_DEADLINE_INITIAL, true) SCHED_FEAT(PREEMPT_SHORT, true) SCHED_FEAT(PLACE_SLEEPER, false) SCHED_FEAT(GENTLE_SLEEPER, true) SCHED_FEAT(EVDF, false) SCHED_FEAT(DELAY_DEQUEUE, true) SCHED_FEAT(GENTLE_DELAY, true) If that doesn't do well enough, could you please try, in order of preference: 2) NO_GENTLE_DELAY 3) NO_DELAY_DEQUEUE, PLACE_SLEEPER 4) NO_DELAY_DEQUEUE, PLACE_SLEEPER, NO_GENTLE_SLEEPER I really don't like the EVDF option, and I think you'll end up regretting using it sooner rather than later, just to make this one benchmark you have happy. I'm hoping the default is enough, but otherwise any of the above should be a *much* better scheduler. Also, bonus points if you can create us a stand alone benchmark that captures your metric (al-la facebook's schbench) without the whole chrome nonsense, that'd be epic.