Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2816212rdb; Mon, 5 Feb 2024 20:42:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGP/b/PNE5I6szqJHRoqmwu8U97jPMhLyXtdJeBAillaquTbC+y1aHb4XuQc+fhqRnkbF8q X-Received: by 2002:a05:6358:d599:b0:176:302b:addf with SMTP id ms25-20020a056358d59900b00176302baddfmr2037719rwb.11.1707194542826; Mon, 05 Feb 2024 20:42:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707194542; cv=pass; d=google.com; s=arc-20160816; b=1IxXNzhCLQyuwbTYWuF8EYZ4sZ1jWhTryzURNu3DwVX3NsP2OloWjftNjnobZkAseX ncTnjR+JSlA5b5jm4RnEEgAKNdiAab5TaTdhUwSSa0JzcWWI6UmzhW9Z3963uU9cQmbB 71/eD5T6p0O3A7G3aApgionqsXgz+6Yrdn1EI3i616bR9DAApeCiVyJ2vbTYZ9Ii7yZ/ NilIjDfRahWjUuN3Et/PRMMIZ0uGj5zPY71kgU4VA0F8j5+Q7TyqagcZ1nkSR3dmrWYm YnKd2E+aK2VyaFKL7LxOk9O8khU+hwLnBkZ+/KQBWO+T7a8oC213B05I6mJLJURUwygU QcrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=fwyA0iOp0hGdi4UEoMdS/esY5ki+GqxLPXq+pqSYOeM=; fh=8Ot1Brkbwlj6TFXluUBuSg5OWiQVAa3/28KSvZLoADE=; b=L59kpN5UTRNTq8+VM+fQy0KMzfDrDaQy9Mgz0L78ADyg9qJrhs/E65t9EnImK80zmv uWQ4ZY3dsJWx21q23qfEE0+GTAnm8An9TeFUX/aonbFqUy3f9ZzD+xHlM08XlDib0o88 4RMEf9iAWgwrgsavs+D5Z7knTJ+g4WIqQao9nOYHBS16opiH735Z6xl7mqofpWCm/yfB YlscAkvHXsG2Z+PJEbl9S1gqyOIctH8P8LhFtMb3Dhgi2AfulvbFGX2Hpzp0ZkORMM61 UHDISkp70Fuaj9Uf7UssHQXwtOm0YGKH9PP6RhvCU5dQj8oxt4Z31VETwRTI4mJGTnhB tBVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-54318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54318-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUNGshXFJOUyu+dIVxFT2RkLRFluov4WZYDWmLrBz3KQeX6Jk4NKtSovakHtf6yg6o6+yHOlXnTJ7cJXqtBuwDC4/Xdqge52Tjseygz8w== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id hq23-20020a056a00681700b006dfe50c6c86si939187pfb.212.2024.02.05.20.42.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 20:42:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-54318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54318-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8D23FB218A3 for ; Tue, 6 Feb 2024 04:39:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0075A7A718; Tue, 6 Feb 2024 04:39:31 +0000 (UTC) Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1F8677F0D for ; Tue, 6 Feb 2024 04:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707194370; cv=none; b=MMTGePwhn8qYmTpChAY241ttXOKMd+c9gHoSdkl3/6OSNEoJfrryipvi6XBgKQPSRpi1PopB9pJfZ02otWJA7X965TrkS4rApT0nWKmOY+b5yo1QERleKsxyeh803svAyuMUamZ05DRMkvmQh8C/hyhG8rbaVfXiOkmYeAymtdE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707194370; c=relaxed/simple; bh=6mkJTp+YntfTBR22eAXEk5YJrTS3d/+TlyZSgog8VHw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u+CjIog98GyG+OJAjQZxzFEe3FpaAfc2dfoQSbXm/1pZAM+cVNlQ15fYw6NQCUvZdQpk+625NI1orArIrzlWbvViO44iK5WobT45VF6/kPlIkVMhRLt/PpplZMbxdF6AtQl8HqQP3wj6KSHGz43ED7QCwCfOprDSAPy5jQSyYmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=manifault.com; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=manifault.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-42a31b90edcso28518721cf.0 for ; Mon, 05 Feb 2024 20:39:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707194367; x=1707799167; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fwyA0iOp0hGdi4UEoMdS/esY5ki+GqxLPXq+pqSYOeM=; b=eEeDYCzlFvfGcDcmZ/d2lmQuC1im7AiGHSTo+6zrGu4f8Z2HtiKRB8LfAckeafmavM U0siuZRXIOvM9/JZlUii0/8MvLbcWygwxEDhiU4l1pSmQQ0pySZqmfU9PdhaHUg+ByfZ C0UyKyLq5wAeEalSixkeu19yQhR7v8S6qtvtkWj9aOF6tD1WpWmZ442EXx7qCkGxgzs6 P34EU51h0FVEMJtRJcyCWmiW97TsbuNZ08C2ZrxUvat/6t4/JpALMGRt0OvtR+LzRd0G yZkQW0fZng2/9tmf7f9IhrbToTlnU9tYxGboqyly2fd3Xo5DYGLcwVjcnUjqXP2+flaH boyQ== X-Gm-Message-State: AOJu0Yw0zjKcSsTOEQu2f4dQJVRv7FD8ttmmfKAjD311m5aK/Gy/Z1sv j+RaH8/rPzU4KS9qj+5hyDD2Mcktw+Fe3XtJYIYgMfDYPgkWdCeYFWky3Ie5Fn2OGQ== X-Received: by 2002:a05:622a:1a92:b0:42a:a6ed:5440 with SMTP id s18-20020a05622a1a9200b0042aa6ed5440mr1915358qtc.3.1707194367154; Mon, 05 Feb 2024 20:39:27 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUQYkQrg1jQLkKhWe1/10W7B7YSHqfVYXEEYIvRxdpvHy25dCnd14XITuhu+gFuHGAxIsgcC6ZVdscA9v7wNU3xIQ00UQYpkUvi54s4VwYrEohSnnn9HyR0pHp5lVh396m/7yALTspVKEMFVbZewwGSUhhe22ATxjHzOvBbCWhBtVUN3ZeLJ4fL/PCc1H2lwdqg50cWOZHte/fggiX/1IDcGX1dEBYY9ARdKUmCWrKj3pBnOPqH7UaSz4vp5+lBY3MivKqKJ5Ox0eMJPddv3yzfROqvZoV2WfvyO9YTwLsSqbuILXI= Received: from localhost (c-24-1-27-177.hsd1.il.comcast.net. [24.1.27.177]) by smtp.gmail.com with ESMTPSA id j25-20020ac874d9000000b0042994b3c20dsm570517qtr.29.2024.02.05.20.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 20:39:26 -0800 (PST) From: David Vernet To: linux-kernel@vger.kernel.org Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, kernel-team@meta.com Subject: [PATCH v3 1/3] sched/fair: Remove unnecessary goto in update_sd_lb_stats() Date: Mon, 5 Feb 2024 22:39:19 -0600 Message-ID: <20240206043921.850302-2-void@manifault.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240206043921.850302-1-void@manifault.com> References: <20240206043921.850302-1-void@manifault.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Vincent Guittot Reviewed-by: Valentin Schneider Signed-off-by: David Vernet --- 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 b803030c3a03..e7519ea434b1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10578,16 +10578,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; -- 2.43.0