Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1005625lql; Tue, 12 Mar 2024 05:00:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdVWuaepYUEPIe04lyyQtSXsfq+vjyoj5mPNdJa32/obRQ3ijBxf1bE2dPnA2Q/Nhe0jh9ZCnVxEIo0AZQ40JepA09gYaPsF7XPnaRNw== X-Google-Smtp-Source: AGHT+IGebxEJTmNh2259e+M3zwhmB3/pUdOZG8BAlEuvRYtCdB1+2ZjHC3QnhCL+yLcinORjqmXW X-Received: by 2002:a17:906:a3cc:b0:a44:8daa:684b with SMTP id ca12-20020a170906a3cc00b00a448daa684bmr82985ejb.3.1710244834877; Tue, 12 Mar 2024 05:00:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710244834; cv=pass; d=google.com; s=arc-20160816; b=QotzSM+umylqo4esBoL1nFezO/x8dE6x6JPQDK4CZPu3a/TsA1EO0YLOCmlFpg+il1 3Bk3nRyVSnI05V5KsmTYufIiLlL7OWTB1qVaNwGDTBGJq7k2KXVKkaEMVH5do0U37bZ4 GdIp84seVN4gYvW8/UYQQXpQnSrZ7imvdmS4DH95QocL+pV1nfwsjugH3j2aD7owUCO2 WYyDdwd02iLwBMbQAlCnHo7PY6RFJZDdLFPrR8fHTt2B6GT+3uwypLYEqLjbNX7TjgXU PsSIDJn5Zs13ltuptAa1jai1oSUZMVDyKnr66JlRUJFJDg3fk7jnzFRYbPxtt8CR9ElB ikfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=8/XIY7++yUOkom3Z43lhbUS04fROMAoyOpQ6RGjet9E=; fh=t4l/6dU3pfnn7MYfnMazFZzgTmO0SkRDf37FwF3qJ8A=; b=ABUcX+zhmN7bol/C/gYGA0UcrAot46rc64sN78dcqlk2/Y1pnSmHVxlIsyhNCLd51Y X8a61MWOhcvafkjh6ZhunzvHXgel03y9vhcZFV05DWNGC5ZAbSmyihoDVrPguxxtc4nd 2WQ7eUkF9TYI2rye/tUTj14/qF6yYOgy/E/TUQJ4aej/qIkVzFnE6s8fhq82OzmZ8c3z TPbEK9aotUbULJnnMHyl+XRjBu+E7xluFGNklusJsFPiV3RpwvUOANsw4h1atynTEfBP qRPOHM/dhk7b7jVjrC/fysFSO6unnDkP7UdKBttd9CuKZ/iEHfZkUmR0V2J+ZjOpRdR6 aSXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MhCoOfXA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-100202-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100202-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gq13-20020a170906e24d00b00a464ca9ff3bsi63932ejb.204.2024.03.12.05.00.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 05:00:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100202-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MhCoOfXA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-100202-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100202-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 97D641F226AE for ; Tue, 12 Mar 2024 12:00:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 254507A121; Tue, 12 Mar 2024 12:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="MhCoOfXA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="e7UrunNh" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D114E79B9B; Tue, 12 Mar 2024 12:00:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710244822; cv=none; b=rUZzbNzSQTfGcJYEUNCxmo6QFflY7vZJ4GsUdNtC+uEjRHxKR1tEpPchcLCefFc3TIrTVi8DGZEDNm8o9FVafV37d7OSg0jVt8UsuBDh1IdfT8E/z4dY2TZ5Omyqj1Y+18z8JA4OMbJX0ETREUXGLmWi4zLC6bFKoBIefnVWDw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710244822; c=relaxed/simple; bh=v0hv7sduDpVvlHwqpVb0Dpchl23luLw9eUQRFFsz2Cs=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=MU5ypWHid3O1/cxMfNtVmedc1eZCwIepP6SgGH4gcL1zBHbRS5kJdvnGhJ957D+Rfbjr69UliJXi9f9K/eQf9QK5ySxfaHl08AcjsSbRNnT3R6u0k71vpFF5MeXStNVoWut32Nli3jWkrXzsQuBXH6pdshECLAseMp6Z6aIhhg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=MhCoOfXA; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=e7UrunNh; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 12 Mar 2024 12:00:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1710244819; 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=8/XIY7++yUOkom3Z43lhbUS04fROMAoyOpQ6RGjet9E=; b=MhCoOfXAESGG7aiiMhTGB/FdvbHX9x173Jx1vpeViOcJ/yXd2Qr0sI3wnm2OjUmkJcHiJG L/s17HJxAoYEEp2943bsVaNEAftEkFQIPIf3OkjdF/g6EOw4hEPDWlaEJb3udENheeeDUO 6puTQ31ZzoI3ZsoYUz485t2BSkDQXd7jXt/yuSqqXiciZvV+0xT1I73cb9fdx2M9P1ST3F 9A/pf5OX54QzPaP9BopEyhbTEEmyCaVIAm9Smk8xJhbeN2at49gmNcZl9q7I2MFPSajgXC nMtDF4LOCCsuLBx+U8lsK4Aip/AzqVlHsfPiTtuFoWy4dNW+SiUih7Dc58NKWQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1710244819; 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=8/XIY7++yUOkom3Z43lhbUS04fROMAoyOpQ6RGjet9E=; b=e7UrunNhYXsDSA7aY1+qtROJXLDY6QJJO1ZRBfj8Dm5OqSP2Oc301tp7KkFG7Q+/K7Z921 pqQGKT9ckMSAW9CQ== From: "tip-bot2 for Ingo Molnar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/balancing: Rename find_idlest_cpu() => sched_balance_find_dst_cpu() Cc: Ingo Molnar , Shrikanth Hegde , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240308111819.1101550-14-mingo@kernel.org> References: <20240308111819.1101550-14-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171024481845.398.6678071993830758312.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the sched/core branch of tip: Commit-ID: 686d148cbb5a1c2891914b8d11147d3c5556a29a Gitweb: https://git.kernel.org/tip/686d148cbb5a1c2891914b8d11147d3c5556a29a Author: Ingo Molnar AuthorDate: Fri, 08 Mar 2024 12:18:19 +01:00 Committer: Ingo Molnar CommitterDate: Tue, 12 Mar 2024 12:00:00 +01:00 sched/balancing: Rename find_idlest_cpu() => sched_balance_find_dst_cpu() Standardize scheduler load-balancing function names on the sched_balance_() prefix. Also use 'dst' instead of 'idlest', because it's not really true that we return the 'idlest' group or CPU, we sort by idle-exit latency and only return the idlest CPUs from the lowest-latency set of CPUs. The true 'idlest' CPUs often remain idle for a long time and are never returned as long as the system is under-loaded. Signed-off-by: Ingo Molnar Reviewed-by: Shrikanth Hegde Link: https://lore.kernel.org/r/20240308111819.1101550-14-mingo@kernel.org --- kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d0c3a09..4b3c4a1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7160,7 +7160,7 @@ sched_balance_find_dst_group_cpu(struct sched_group *group, struct task_struct * return shallowest_idle_cpu != -1 ? shallowest_idle_cpu : least_loaded_cpu; } -static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p, +static inline int sched_balance_find_dst_cpu(struct sched_domain *sd, struct task_struct *p, int cpu, int prev_cpu, int sd_flag) { int new_cpu = cpu; @@ -7936,7 +7936,7 @@ compute_energy(struct energy_env *eenv, struct perf_domain *pd, * NOTE: Forkees are not accepted in the energy-aware wake-up path because * they don't have any useful utilization data yet and it's not possible to * forecast their impact on energy consumption. Consequently, they will be - * placed by find_idlest_cpu() on the least loaded CPU, which might turn out + * placed by sched_balance_find_dst_cpu() on the least loaded CPU, which might turn out * to be energy-inefficient in some use-cases. The alternative would be to * bias new tasks towards specific types of CPUs first, or to try to infer * their util_avg from the parent task, but those heuristics could hurt @@ -8201,7 +8201,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags) if (unlikely(sd)) { /* Slow path */ - new_cpu = find_idlest_cpu(sd, p, cpu, prev_cpu, sd_flag); + new_cpu = sched_balance_find_dst_cpu(sd, p, cpu, prev_cpu, sd_flag); } else if (wake_flags & WF_TTWU) { /* XXX always ? */ /* Fast path */ new_cpu = select_idle_sibling(p, prev_cpu, new_cpu);