From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6741C433F5 for ; Tue, 21 Sep 2021 07:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D03B06126A for ; Tue, 21 Sep 2021 07:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbhIUH3c (ORCPT ); Tue, 21 Sep 2021 03:29:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbhIUH3X (ORCPT ); Tue, 21 Sep 2021 03:29:23 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76DFDC061575; Tue, 21 Sep 2021 00:27:55 -0700 (PDT) Date: Tue, 21 Sep 2021 07:27:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1632209272; 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=N4tTuDyZHscwodQW4lf3KyI5mwC2xBNvkHxnDrvDrNI=; b=N4xxFs8jYu9GaF8vqatJXOa3NP2k+kIAojkMxnxp4zM4AYRvkcc37DWieN5RqykHyc9OAx v9jhZRDrVGLaFTHrTvrcsV9CgQ/l6MhHgBuH4OujaATEHsiOYEWvNdz3JpPIdKSeBv6o5H VL9LreexBOiRkEGR8JuACJzsuk++lc0l6EOxKlbk0N/v4CSMadb9NgRJ1lVT0oM6mkREZt T6tLkZGOMqqqk86+F8ZS88WNaztZkeWmv2dcNAjHutGo4npOrGEi2oyAr0GW0PQINLImH7 HvOnqI2qfFmQOu0gQAXMh/7Ejo6HeRIwX2XMH/Naj4P01Z/i8NNDfh8XRTkEXg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1632209272; 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=N4tTuDyZHscwodQW4lf3KyI5mwC2xBNvkHxnDrvDrNI=; b=Jln6wKgf1YT1xAfVjWKu353FhCBzVZ4Q/W8goZcmdYw0SAO+bVghh7toZMszCEsM4y0bnv /Zut+0QR47pkrTBg== From: "tip-bot2 for Ricardo Neri" 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: Carve out logic to mark a group for asymmetric packing Cc: Ricardo Neri , "Peter Zijlstra (Intel)" , "Joel Fernandes (Google)" , Len Brown , Vincent Guittot , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210911011819.12184-6-ricardo.neri-calderon@linux.intel.com> References: <20210911011819.12184-6-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Message-ID: <163220927155.25758.17787965953687869633.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: f58215ed2ff917dc40e6fb7b2d9b7fd290ec5055 Gitweb: https://git.kernel.org/tip/f58215ed2ff917dc40e6fb7b2d9b7fd290ec5055 Author: Ricardo Neri AuthorDate: Fri, 10 Sep 2021 18:18:18 -07:00 Committer: Peter Zijlstra CommitterDate: Sat, 18 Sep 2021 12:18:40 +02:00 sched/fair: Carve out logic to mark a group for asymmetric packing Create a separate function, sched_asym(). A subsequent changeset will introduce logic to deal with SMT in conjunction with asmymmetric packing. Such logic will need the statistics of the scheduling group provided as argument. Update them before calling sched_asym(). Co-developed-by: Peter Zijlstra (Intel) Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Joel Fernandes (Google) Reviewed-by: Len Brown Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20210911011819.12184-6-ricardo.neri-calderon@linux.intel.com --- kernel/sched/fair.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d592de4..6d27375 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8538,6 +8538,13 @@ group_type group_classify(unsigned int imbalance_pct, return group_has_spare; } +static inline bool +sched_asym(struct lb_env *env, struct sd_lb_stats *sds, struct sg_lb_stats *sgs, + struct sched_group *group) +{ + return sched_asym_prefer(env->dst_cpu, group->asym_prefer_cpu); +} + /** * update_sg_lb_stats - Update sched_group's statistics for load balancing. * @env: The load balancing environment. @@ -8598,18 +8605,17 @@ static inline void update_sg_lb_stats(struct lb_env *env, } } + sgs->group_capacity = group->sgc->capacity; + + sgs->group_weight = group->group_weight; + /* Check if dst CPU is idle and preferred to this group */ if (!local_group && env->sd->flags & SD_ASYM_PACKING && - env->idle != CPU_NOT_IDLE && - sgs->sum_h_nr_running && - sched_asym_prefer(env->dst_cpu, group->asym_prefer_cpu)) { + env->idle != CPU_NOT_IDLE && sgs->sum_h_nr_running && + sched_asym(env, sds, sgs, group)) { sgs->group_asym_packing = 1; } - sgs->group_capacity = group->sgc->capacity; - - sgs->group_weight = group->group_weight; - sgs->group_type = group_classify(env->sd->imbalance_pct, group, sgs); /* Computing avg_load makes sense only when group is overloaded */