From patchwork Thu Aug 10 07:10:52 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: 133729 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp249089vqi; Thu, 10 Aug 2023 00:40:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFw/SEAB85YaBq6K7NjprcVzoCs6EsnuMZjV3JOGpjrasYbVm/ztQyc7XoLYt8y8fndkqcy X-Received: by 2002:a17:903:228d:b0:1bc:6e5f:392f with SMTP id b13-20020a170903228d00b001bc6e5f392fmr1889240plh.48.1691653249836; Thu, 10 Aug 2023 00:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691653249; cv=none; d=google.com; s=arc-20160816; b=0CsFDhw06zpoIskMzj6sxjAKO06aDx7MWndl2LQyKLPvcULh2sEBJmOY44kQ1rwGhA T8SJyzgXHe9z32eY1VG5M8KlIqt1OWHasTs1uw759PuK3Vn9QCyp4OKchP7+DE/Pq/6U RpfevUdmuqlH/HlaLCFJn40t609cLRxIlIWx74sRpiTYtIbiY6HrzMa2r0442xVQfbtY BzQejxAoNFklh2A0egmbUYZC5qALrOC40RfaB+2M4wlb5DtG0Ajng7a+eEd3WSMSqZO/ 1AyBNp1QqB6XEA3ZKE74cCMbVjDKQw7TiNESnLvpn3C9mdP5Vj6ftxu/ilbmjyAPAbES pIjw== 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=Y+t+Hn9BMuqn0HYD61DzGQMc+TnHT3KZlNg5KP22Z74=; fh=vkqUiGzLB1kYJlh6VK0MMfK5N8EB/xst0EWTlb2LqmA=; b=QZcf4qIa54xzcsWwvW4qEZ/x/pVVIsuuD0zmi9riwuPDd9Yhvy1CoYuwMMWMn9X00g HakkkINZH7sAdTKdD5ulfMhMmdw7yWIkTsoEdnW6EW658JsuQuhj5TP4b/50qbcQefjC EX1HRNHqIc526TmLKKdN/q5abiBolGIRcHQIPzvIKKNBs+jGCB4SIZVdS7D/Y7cLdFs7 GQF5WueT+kuJQn3DHzibCdRMRrYU/Q4Qpk8HnTEQ49FCevXSSnugJvVBHlnbeXts2Po1 mNvpxXP8nD30s9yPpynIQ7xqZKGIkgoiBFYKzkTRY6o6RObbpZtlI2/IEaOO/jFpUzwQ sX8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0NAsilt6; dkim=neutral (no key) header.i=@linutronix.de; 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 lf3-20020a170902fb4300b001bb94f4112dsi940337plb.580.2023.08.10.00.40.36; Thu, 10 Aug 2023 00:40:49 -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=0NAsilt6; dkim=neutral (no key) header.i=@linutronix.de; 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 S232147AbjHJHK6 (ORCPT + 99 others); Thu, 10 Aug 2023 03:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbjHJHK4 (ORCPT ); Thu, 10 Aug 2023 03:10:56 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE47FE64; Thu, 10 Aug 2023 00:10:55 -0700 (PDT) Date: Thu, 10 Aug 2023 07:10:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691651453; 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=Y+t+Hn9BMuqn0HYD61DzGQMc+TnHT3KZlNg5KP22Z74=; b=0NAsilt6h+hcyW4zKfAbuXfRUb1UfKqYKi4KCmJUITOlxoRCubzriC2itYeYVYDRajpN/y wi8rOhuUY0QawmAosWIriOVfJGI7Xu6sdQp7EmfV3OIPMU2Nv+Muw57Jwy4EFZ++BZJRDj BrbUOaNJ2ZvgXzeefwz7p4L8dBS+zt6wHfeJdLSgQZ74J/7J3pA7ujj5LeJ0JADbaPOdpy vQkTL3LmCKkjRZ9mgFDmQSIAL2Sqbl22tVzhtCkbEkTOmAQhj27zDrqR2t04/tdq0N+XJ8 t4YpacHXcXtl0JcAM67hq0wVVlrzk0KD6+fU99xIJzkIoE0nyo3qfnOrIPX5Mg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691651453; 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=Y+t+Hn9BMuqn0HYD61DzGQMc+TnHT3KZlNg5KP22Z74=; b=y83y/SkAiwx2RemuNdF3ZM7ThgEkw0oT/xTZdmElXidezkoqmtPC5pISVKd+RVLPTEjnaw wLqBWORb3WtG5pAA== 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: Propagate enqueue flags into place_entity() Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230531124604.274010996@infradead.org> References: <20230531124604.274010996@infradead.org> MIME-Version: 1.0 Message-ID: <169165145291.27769.13852159578081861156.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,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: 1767414490374786339 X-GMAIL-MSGID: 1773826997899340063 The following commit has been merged into the sched/core branch of tip: Commit-ID: d07f09a1f99cabbc86bc5c97d962eb8a466106b5 Gitweb: https://git.kernel.org/tip/d07f09a1f99cabbc86bc5c97d962eb8a466106b5 Author: Peter Zijlstra AuthorDate: Wed, 31 May 2023 13:58:49 +02:00 Committer: Ingo Molnar CommitterDate: Wed, 19 Jul 2023 09:43:59 +02:00 sched/fair: Propagate enqueue flags into place_entity() This allows place_entity() to consider ENQUEUE_WAKEUP and ENQUEUE_MIGRATED. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230531124604.274010996@infradead.org --- kernel/sched/fair.c | 10 +++++----- kernel/sched/sched.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 61747a2..5c8c9f7 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4909,7 +4909,7 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) {} #endif /* CONFIG_SMP */ static void -place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) +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); @@ -4998,7 +4998,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) * on average, halfway through their slice, as such start tasks * off with half a slice to ease into the competition. */ - if (sched_feat(PLACE_DEADLINE_INITIAL) && initial) + if (sched_feat(PLACE_DEADLINE_INITIAL) && (flags & ENQUEUE_INITIAL)) vslice /= 2; /* @@ -5022,7 +5022,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) * update_curr(). */ if (curr) - place_entity(cfs_rq, se, 0); + place_entity(cfs_rq, se, flags); update_curr(cfs_rq); @@ -5049,7 +5049,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) * we can place the entity. */ if (!curr) - place_entity(cfs_rq, se, 0); + place_entity(cfs_rq, se, flags); account_entity_enqueue(cfs_rq, se); @@ -12280,7 +12280,7 @@ static void task_fork_fair(struct task_struct *p) curr = cfs_rq->curr; if (curr) update_curr(cfs_rq); - place_entity(cfs_rq, se, 1); + place_entity(cfs_rq, se, ENQUEUE_INITIAL); rq_unlock(rq, &rf); } diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 7ff9965..db58537 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2199,6 +2199,7 @@ extern const u32 sched_prio_to_wmult[40]; #else #define ENQUEUE_MIGRATED 0x00 #endif +#define ENQUEUE_INITIAL 0x80 #define RETRY_TASK ((void *)-1UL)