From patchwork Thu Aug 10 07:10:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 133776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp285413vqi; Thu, 10 Aug 2023 02:09:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfc0tX/P+zqCqIeAadcwq1o5ktLpk49fflqH7W9N3czlkImz2foBQXVgsEUNiJgfuJ+lrg X-Received: by 2002:a17:902:ecc1:b0:1bc:9bb3:1d83 with SMTP id a1-20020a170902ecc100b001bc9bb31d83mr2404360plh.33.1691658541531; Thu, 10 Aug 2023 02:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691658541; cv=none; d=google.com; s=arc-20160816; b=JePP0qPa77tER9mX/YPmc4LGGGwFODoCGnz6tjMfkxATKJS0opFJYpYZXsZ5JepPVR gqeidrCiTBiRfTnoiiwCWKkVvZjC7AszccxDQ/hZfTr9eFDuPekXKn9aWcbaVHGkKo6S /jfZcU8nn781QiUy6LNYfpAkapSHPMihJ9GTBV+Zgrt2yLBCcLehkd7+Z4yCV4FIYiqU PmH1o6Axu0NCmA8X8YTquU32nfQxPWUNMcGyElfRnGVU72yjGI/qgkGkBaR2j43pCJag gLiDY+Ij7GjhP1CbouvfeJO2eJORpb1gcVRU1wvByNRO4Jbo+KZQWDZqedae0aUy+gl/ 8CVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=V6LBU85QchwzGO6KS9gGSbjstTRukMDpbcvc5ZosSeQ=; fh=vkqUiGzLB1kYJlh6VK0MMfK5N8EB/xst0EWTlb2LqmA=; b=o/iusu+j0t8bK5GkXosUlXqKwJuDchca9Ht/T3zpeFA6neM+OchtePbj6wxRmyqSoN 1Q57GFRCVVgM3geqH6gU408yBrBPhPUdrHfQ3+qlC3azxHpC5cSDjUL8cDpst/nEyrk6 fRR0weEzoLAQJ3k5KhF+Ott6E/O7gB7gusnQgYkU3ixQ3o1rCbDAtKv892PCHMCI0AgI PRRYJrIVu4L3XnfkXscISOPVL0lV9DEQM5MKqsW7yhYT8kLoT3tyQQv8n6/uiniPx81J StblHdpgGFFl5DDEKHF4hPkAP497tPdZ+Y3RtEHH048fN8QArIv0R4L7gTPrc69zyYzZ Ibww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dDjlisZC; dkim=neutral (no key) header.i=@linutronix.de header.b=QgnWYeQz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s20-20020a170903215400b001b9c992945fsi1076882ple.555.2023.08.10.02.08.47; Thu, 10 Aug 2023 02:09:01 -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=@linutronix.de header.s=2020 header.b=dDjlisZC; dkim=neutral (no key) header.i=@linutronix.de header.b=QgnWYeQz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233850AbjHJHLU (ORCPT + 99 others); Thu, 10 Aug 2023 03:11:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233747AbjHJHLB (ORCPT ); Thu, 10 Aug 2023 03:11:01 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AAA4F3; Thu, 10 Aug 2023 00:11:00 -0700 (PDT) Date: Thu, 10 Aug 2023 07:10:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691651459; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V6LBU85QchwzGO6KS9gGSbjstTRukMDpbcvc5ZosSeQ=; b=dDjlisZCKE4lDiFwHzkfvXBl9d8/dcXWcnB/hA+e1eyRgXXQaXDd1fpuIB9EZAaq+lGa44 pFeIKiayPrrgWzfF6Xr5+H3CbBnb6lbS1RL2Sx/WlgwB+v0OL2j/BKgjtkVbFM8HNt9JBR WBsdmMjSqQt4ijUL0VQoZvLdKJxYEW7Vlm+warFv7WuEYqNdS+6TNZYohKFdgSP4znTI9g I0jKYLga4JpzVWgg3bJjRUkKNCGuJslqonVDBYZa7wnDY0ZdPlDx/KJZkqvu83cd8N1wnE 29L49+Q2+r5Bw5ZhI++By1KWlfLMW2J7MY4wc/ozRRwPXNjVj4OTLwF5Kcn3vQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691651459; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V6LBU85QchwzGO6KS9gGSbjstTRukMDpbcvc5ZosSeQ=; b=QgnWYeQzlZteqBxVyPosIOpllcIeOB3+qeyXKsAVS3FZ19uR4lnG2Uud1knCV20RK+X+sU dqj00doh/VIumXDA== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/fair: Remove sched_feat(START_DEBIT) Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230531124603.722361178@infradead.org> References: <20230531124603.722361178@infradead.org> MIME-Version: 1.0 Message-ID: <169165145843.27769.11310689904341154664.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DIET_1,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773832546520283210 X-GMAIL-MSGID: 1773832546520283210 The following commit has been merged into the sched/core branch of tip: Commit-ID: e0c2ff903c320d3fd3c2c604dc401b3b7c0a1d13 Gitweb: https://git.kernel.org/tip/e0c2ff903c320d3fd3c2c604dc401b3b7c0a1d13 Author: Peter Zijlstra AuthorDate: Wed, 31 May 2023 13:58:41 +02:00 Committer: Ingo Molnar CommitterDate: Wed, 19 Jul 2023 09:43:58 +02:00 sched/fair: Remove sched_feat(START_DEBIT) With the introduction of avg_vruntime() there is no need to use worse approximations. Take the 0-lag point as starting point for inserting new tasks. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230531124603.722361178@infradead.org --- kernel/sched/fair.c | 21 +-------------------- kernel/sched/features.h | 6 ------ 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bb54606..fc43482 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -906,16 +906,6 @@ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se) return slice; } -/* - * We calculate the vruntime slice of a to-be-inserted task. - * - * vs = s/w - */ -static u64 sched_vslice(struct cfs_rq *cfs_rq, struct sched_entity *se) -{ - return calc_delta_fair(sched_slice(cfs_rq, se), se); -} - #include "pelt.h" #ifdef CONFIG_SMP @@ -4862,16 +4852,7 @@ static inline bool entity_is_long_sleeper(struct sched_entity *se) static void place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) { - u64 vruntime = cfs_rq->min_vruntime; - - /* - * The 'current' period is already promised to the current tasks, - * however the extra weight of the new task will slow them down a - * little, place the new task so that it fits in the slot that - * stays open at the end. - */ - if (initial && sched_feat(START_DEBIT)) - vruntime += sched_vslice(cfs_rq, se); + u64 vruntime = avg_vruntime(cfs_rq); /* sleeps up to a single latency don't count. */ if (!initial) { diff --git a/kernel/sched/features.h b/kernel/sched/features.h index ee7f23c..fa828b3 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -7,12 +7,6 @@ SCHED_FEAT(GENTLE_FAIR_SLEEPERS, true) /* - * Place new tasks ahead so that they do not starve already running - * tasks - */ -SCHED_FEAT(START_DEBIT, true) - -/* * Prefer to schedule the task we woke last (assuming it failed * wakeup-preemption), since its likely going to consume data we * touched, increases cache locality.