From patchwork Wed Feb 28 22:00:09 2024 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: 208043 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:a1a:b0:17b:cd04:e0c6 with SMTP id 26csp218605rwa; Wed, 28 Feb 2024 14:02:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXx8kykF1UK7j15RNV+m/yXfwJV4uAzeWQnA4rlRsUrzp1e2EfQjUM5k3Jc3K0aEn6pOIC75662GFJMU2ICqQbUBnAwyQ== X-Google-Smtp-Source: AGHT+IHOQ8wKq2vuMvfpaQQ2L+/DtCpR0jG2T6dBqdpWXcYTZ9HVF+svrnzq0Kp/uTZpilb6qIz+ X-Received: by 2002:a05:6a00:17a6:b0:6e5:5425:d914 with SMTP id s38-20020a056a0017a600b006e55425d914mr598600pfg.2.1709157732193; Wed, 28 Feb 2024 14:02:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709157732; cv=pass; d=google.com; s=arc-20160816; b=yYrbcTdSwAsUTPp6/NDAzXFCNBg9t0e2yGZ/vL+jvM4CWx8ayAIC8e+M4EUP1J6k+I tUgyLJG01fejec3r19h5FTcrSrcStzUC7QGG8bdbCsnaoHruH/WtFvxcTNW/2z+w0s9C Bg//gOAdIfD4lH39gyekBzMpc5RQ31sGGfUawOzek69StSTRyaO9xaBg5DGHoYxW3xyV SLzyFHdwyx9c4XD+omoRj8cZJgn7BMEBOhrKJ286+FWnNYGOTgSeFdJBsY610Wv80ooR +OZaJQ17iJuWlsRxZ/ykFpPKiE1FQo5sNqAtfgvjEPAcXZOspUL06OUJuAUIc8xbutyZ 8b0g== 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=a40RlwL8R2DxtAw9DQ1Rv47BdvRqUCvsOh8PymgKpb0=; fh=aKsKE5fLBw4tya2d2+dn+6dU3ZzlKFdKa4YkHd3HkLY=; b=WRpOEuizLUoEdCnS3hdDSWJ79basVvQS0Lv3u7230B2pMtQFTJwp1EzjZvR7R3QKrq OwqZ/Em9vPyMrC4VdbM4/PqdibDTN86FMc5lso+yosS+Ur2htihzSN+4oEid0wikHgx6 mu3fdJqL97QFQvb27hhSgL7lOKXpMirwUnDm6DVu1bmSgu2Hb1RyOgQA8WUX6SjVHC+g pPsWmwLNw0a6q6HPKWS24jZFPF2UmZyiYnRbE17XafIxjluVeFwfUB9F3B/ZbcuaJAh2 RC4dWxABNjuzdmxLIlmQ4bhLcjcRYRb09ld1fYV6jEpw/SVwjsOXr4rGoQmFnT0zdHvU yQHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L5aIosW4; 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-85755-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85755-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x14-20020a056a00270e00b006e0dd4e9306si307878pfv.24.2024.02.28.14.02.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 14:02:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85755-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L5aIosW4; 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-85755-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85755-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 230FB28976D for ; Wed, 28 Feb 2024 22:02:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 870D715E5DD; Wed, 28 Feb 2024 22:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="L5aIosW4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="q1kVylNL" 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 BFD3A72921; Wed, 28 Feb 2024 22:00:16 +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=1709157618; cv=none; b=aGSOQ1cbxtYiDVGUZfRD6aVBIpJzPW0iGRLBwfJq10Jvay9cffeHg+IdrXgIh0/Zu6j8W1JhawrJlq4dqPeUP9RhXoovzeq5Pt50qkt6yl1sZEPfBk6hHwAusdzs8AQ3ZnlBLHHUywO10M3LXMo4/EJl01vJ2+2IBKwpaXCWDjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709157618; c=relaxed/simple; bh=Kbc3CBARYMyxP7nPSVDq+QDIHWWxcTvx3Pdbwk22UGs=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=SMelB35oeVdQe8bwL0r1PJKQOpQBe9k1r3HNVNStczUsZr9E47fJ+To6NwPH1lbsEJNAL9c+iFCUhjK3o/dm9Vmii/DXCN+FLwIXDWS2ZKksSsesOYzkB4yTKroXgIBcMuoSAEaTcX4CpIBEZwxy2mxd0gAWr4KtDmFsP/0Vbdc= 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=L5aIosW4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=q1kVylNL; 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: Wed, 28 Feb 2024 22:00:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1709157610; 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=a40RlwL8R2DxtAw9DQ1Rv47BdvRqUCvsOh8PymgKpb0=; b=L5aIosW4W7cub/ulHJn4vSWlmA401qPLPee2jmTH2aEwQdSJrVxv3skYFADuVxPajRxP3h nSsAa1ECto86TibDekUCqzGO75hV8hBCDUOO731tyZNEEf1/lmOzbvridBlLP3vBSeHwTB uEpI2M9aj6lxOYCLrmvAdxtlXX3BuEYKiQ9vZauUTG1Eb5yBgNhmVZ1Pbwn9xPLmzplAOL P1xQNHtzqw1j/5yK10Ylezx/QNltL46Wgn5Zn0RISAUH409Do6cukkstxx0k4ns5OHej1K rwJohTg8Famw150o0qeFhxO2wkQc+EQ+4qzG+wQyQhAOh1AXgnCkui8sk1fQBA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1709157610; 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=a40RlwL8R2DxtAw9DQ1Rv47BdvRqUCvsOh8PymgKpb0=; b=q1kVylNL5uS3S2dwyKxxId36I3eo7O2wwMlElo9nB03bIGqhlAnJEELfwtCPsdjXRshUxw MKHSFqF74J3pinDQ== From: "tip-bot2 for David Vernet" 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 unnecessary goto in update_sd_lb_stats() Cc: David Vernet , Ingo Molnar , Vincent Guittot , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240206043921.850302-2-void@manifault.com> References: <20240206043921.850302-2-void@manifault.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170915760996.398.17950890395789943511.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790123078633273597 X-GMAIL-MSGID: 1792181778332953718 The following commit has been merged into the sched/core branch of tip: Commit-ID: 9dfbc26d27aaf0f5958c5972188f16fe977e5af5 Gitweb: https://git.kernel.org/tip/9dfbc26d27aaf0f5958c5972188f16fe977e5af5 Author: David Vernet AuthorDate: Mon, 05 Feb 2024 22:39:19 -06:00 Committer: Ingo Molnar CommitterDate: Wed, 28 Feb 2024 15:19:23 +01:00 sched/fair: Remove unnecessary goto in update_sd_lb_stats() In update_sd_lb_stats(), when we're iterating over the sched groups that comprise a sched domain, we're skipping the call to update_sd_pick_busiest() for the sched group that contains the local / destination CPU. We use a goto to skip the call, but we could just as easily check !local_group, as there's no other logic that we need to skip with the goto. Let's remove the goto, and check for !local_group in the if statement instead. Signed-off-by: David Vernet Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20240206043921.850302-2-void@manifault.com --- kernel/sched/fair.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 352222d..41dda53 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10580,16 +10580,11 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd update_sg_lb_stats(env, sds, sg, sgs, &sg_status); - if (local_group) - goto next_group; - - - if (update_sd_pick_busiest(env, sds, sg, sgs)) { + if (!local_group && update_sd_pick_busiest(env, sds, sg, sgs)) { sds->busiest = sg; sds->busiest_stat = *sgs; } -next_group: /* Now, start updating sd_lb_stats */ sds->total_load += sgs->group_load; sds->total_capacity += sgs->group_capacity;