From patchwork Tue Oct 3 10:42:38 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: 147803 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1992746vqb; Tue, 3 Oct 2023 03:42:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOllB7f1DczGogC6hjBV3a8+1qXllcg1aefoBt8DQJLn6HouIYnVQOhk5BmgBYRo/2JnjK X-Received: by 2002:a1f:cb46:0:b0:49d:9916:5747 with SMTP id b67-20020a1fcb46000000b0049d99165747mr1174118vkg.13.1696329774475; Tue, 03 Oct 2023 03:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696329774; cv=none; d=google.com; s=arc-20160816; b=AxvPFZcItqY/tRKC/i14VU9LabxU3PcuHSTH++HqjZhmpBYA0Th6FXVFrfm050/XzM Kg7s7DFkVWCvnYmfi0bAs7RG4OlRxwgkWvlGv87GmTbmosjS8858eRBDDCXePIyyaAp0 GbtAgezvr863Xt3FuxZWTqRGj0S8gAMoLwtv9flnQmINm++v234vlV4oXZB/VdvKMUSq PSmPRztbTiHrlIwQukSuXRNVTUwywdoyy4qCme/KKRitXiNhDetnhgAPIhZTe9MTS9Op VsPANdJ+6kMvmwwMYjAWwu0mY4Q9rb/Pl48vCGzXm87syOx0dlqxrf9ZSvzOho5Dg0XA 4czg== 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=grakLp/zKCRntxJXoxdacCz+WQGAMempoTpcbELkjtw=; fh=H2MkSknZKy/XcUE0SNWlqZifRHvGVZQUr5cmv0Cbtz8=; b=Pfs48Rq8BETvciEM8ohaN3t8GWWIh8RFvF7rTuw6zA+TrFAxE34ItO5BCpWYwufN9v J9ibfXSJtPBpywcrZCHbccNB9aExJMIuX8Sep69HnOzkzuLkIrCuTgriwYhYO91AZH0E yAStHLYYQoxnZQ42yEUHqmXHYiVIHXcjI2vwVDb5q7T9QAkN2nzhfJiuxYlUQSMcl9pm 9ROxI1p4SPoq2klJZDI/fdX2I9zTORJ6cX0RUIANgy2rDTM9fOafopEfeXKQmVIJ8q+2 9U4yJB22aEeE+BjakopRAp0HKSYBDrsRrXypwrnwy8CyQP4PG5TDDZdymZlUQPK/mPtg ZdTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="h//JyklV"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id rm6-20020a17090b3ec600b0026b51ae4574si10818047pjb.36.2023.10.03.03.42.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 03:42:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="h//JyklV"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B7EB88153D2F; Tue, 3 Oct 2023 03:42:53 -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 S231736AbjJCKms (ORCPT + 19 others); Tue, 3 Oct 2023 06:42:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231688AbjJCKmo (ORCPT ); Tue, 3 Oct 2023 06:42:44 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C204CC; Tue, 3 Oct 2023 03:42:41 -0700 (PDT) Date: Tue, 03 Oct 2023 10:42:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696329758; 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=grakLp/zKCRntxJXoxdacCz+WQGAMempoTpcbELkjtw=; b=h//JyklV+UfhJok2GoSaCoO3WIMDa8IIF6CS8yWIOUbBAqrwjr2Cc6egxisXHBH2dFcSEj GMamkX4q0HlO674s7b92e2720F2z+hkKaUfKGyQo9XYDxBMe8k4f2HnxlBltzmAgv/hUMw TsL/kUl52clwytEUSmHGw5J09qp2OpSl/E3qjGak9Lrl+6AVAC0a/lv0CHblDWEguLX6qT hJZQDggLGNg1x/DoW/j/vhcw7yXrIF79u0B4Idiwx80pGcAzHBd54L/LbDx9O/plXRDWKM Yy1TRoxWM4VhwPbKnOH36E1OfvGTq0fQ2ng1paxxgh4KSJa/VUQjIdUViNacwA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696329758; 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=grakLp/zKCRntxJXoxdacCz+WQGAMempoTpcbELkjtw=; b=Ce6BAYVZuFfPMDWwD1kc69Gglnpwqjyh/9TD+crnlC/58YTnTnbFV/qhI0+ImAainhPaiX JjR2reDWW3wCdXAQ== 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/urgent] sched/eevdf: Also update slice on placement Cc: "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230915124822.847197830@noisy.programming.kicks-ass.net> References: <20230915124822.847197830@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Message-ID: <169632975832.3135.8276089037477460761.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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]); Tue, 03 Oct 2023 03:42:53 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777109927731909318 X-GMAIL-MSGID: 1778730689560879759 The following commit has been merged into the sched/urgent branch of tip: Commit-ID: 2f2fc17bab0011430ceb6f2dc1959e7d1f981444 Gitweb: https://git.kernel.org/tip/2f2fc17bab0011430ceb6f2dc1959e7d1f981444 Author: Peter Zijlstra AuthorDate: Fri, 15 Sep 2023 00:48:55 +02:00 Committer: Peter Zijlstra CommitterDate: Tue, 03 Oct 2023 12:32:29 +02:00 sched/eevdf: Also update slice on placement Tasks that never consume their full slice would not update their slice value. This means that tasks that are spawned before the sysctl scaling keep their original (UP) slice length. Fixes: 147f3efaa241 ("sched/fair: Implement an EEVDF-like scheduling policy") Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230915124822.847197830@noisy.programming.kicks-ass.net --- kernel/sched/fair.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index cb22592..7d73652 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4919,10 +4919,12 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) {} static void place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) { - u64 vslice = calc_delta_fair(se->slice, se); - u64 vruntime = avg_vruntime(cfs_rq); + u64 vslice, vruntime = avg_vruntime(cfs_rq); s64 lag = 0; + se->slice = sysctl_sched_base_slice; + vslice = calc_delta_fair(se->slice, se); + /* * Due to how V is constructed as the weighted average of entities, * adding tasks with positive lag, or removing tasks with negative lag