Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp982214rdb; Fri, 2 Feb 2024 09:39:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSFBQgNt8DALHqjJCH0wydsOWn5uBmk0+4oz8xYYhw7wJBZ12nOJOR1iLzcCZTL4+IXa8A X-Received: by 2002:a17:902:e5c8:b0:1d8:e1c0:1bb8 with SMTP id u8-20020a170902e5c800b001d8e1c01bb8mr4334197plf.27.1706895566055; Fri, 02 Feb 2024 09:39:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706895566; cv=pass; d=google.com; s=arc-20160816; b=WVaFTKsWEM4CiZXvZA1I9gWek+qVmXXSWVYYwyAYuJ8HvitLmsDq6sjrxY/PwaPsPm A+96TIJZZeF6JTxts+qmbFe3hgM/d0oA1igtUDCA1NuNUej71sGavN+dE+Gt7gpFDAjW 7VMHkXLiIDd1AfrpCiZwNKBMmPvfq4MxRQJ9dE9i7+uvCviMF2wm18rRnL46+cW6QnmW td3xZNP6gmxBQdGxDYHDDTDtygLBEvJUI6YchTjInN7+8aBOeWqMqQIF6OXz9q0Ts/WF vqGFuIt7Ol1ADF7j9i4yol9n/6SrtFXBxPBVmlqPR47IT9nUHzaNKyLY0cOOLPZDYj0n snSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=y+gAPT68yktKEC3SZi/PBBCLmq/Ebt4n1T1gRSBSaXU=; fh=O7+0g3wbZveyAH6VkSEdyFnfI5PBanHKT5cyc6ZXenM=; b=n2zZaWn/Jko+u5kMcoDJsc+8wvUHkiaK7VceVM4cZPwSSsJUrpJfO+/cstDkRq4gVl ytZk0n1+BGvz4dvDNN8OmMoFCLyX3W8K3UoXqm5eHDl237X23qSXPZk6lZdCQhcSzGSH VA7i3zT+cHJ/rFTJ7zP2kFey3cEWZxctn2wRzulo20DSb23jPUwX2wW2Qr+AfUGGuzWY l1bRWvDls3BT7ZFXETHazJt8SkAxbwJq7e5hbkPkeK/GEiEN/jjW3HyQs6YTakvpz1hG a2jW0kr4qJSaImmxxosuj9VEuz8YnOkavjFAnhxrbtBsE43+y0gvkepelmZ682T86dpR M3GA==; 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-50208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50208-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVF1TS2zhYlV7zN3ksct2egdkXsM9kl2qW+pHIIb/Kmz6w6CIV2xSNvXG17rtl0vFNTYPI0rBgJMHXPa8kJaNB2Z4t3KHQs4zP7R9NOyQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e4-20020a170902b78400b001d93b220121si2008270pls.91.2024.02.02.09.39.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:39:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50208-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-50208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50208-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 B37F6B2E72A for ; Fri, 2 Feb 2024 17:09:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B40914D45C; Fri, 2 Feb 2024 17:07:23 +0000 (UTC) Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (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 6B53314C5A7 for ; Fri, 2 Feb 2024 17:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706893643; cv=none; b=a6BDWbosFvJgqqE4VPlcEZLLfhhZQ4fNuKQgLS+qW48DFQxGi2gopwaGMZ7yb6cokt3GWAI6Edbj8GdOBXbzr8eRxBm93lNrciSu+VZ2x5DME7sZ4NXX6RMuU2p0ucBsQrDTLGaTJu+4Qur+MYHslASyVToRaRtVO4E5cTijGDU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706893643; c=relaxed/simple; bh=y+gAPT68yktKEC3SZi/PBBCLmq/Ebt4n1T1gRSBSaXU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=U0zo/8voeseIm1EJU6Aq2Q13WbfquYtsWrt4Vx5O10DfVmL6h77VF4jsI5Zf/0h0uol2nzUhNl3xGTyT1ma5bQEcbns3YT/dlX8+RZpxlA/1JQosIYF6C1xWYiMnrxKISkM+5HSn/VvO4kMRQOqqDnbFvi9ZLjP8KpWrqdkmZvQ= 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.219.50 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-qv1-f50.google.com with SMTP id 6a1803df08f44-68c794970d5so15254556d6.0 for ; Fri, 02 Feb 2024 09:07:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706893636; x=1707498436; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y+gAPT68yktKEC3SZi/PBBCLmq/Ebt4n1T1gRSBSaXU=; b=lXSPZ8f6QMAiPzMaF9ru1wjnhcXMPqrS8VQ9PXGPydYlGf4+E7LElId8OI7xthdZ8C ipl2LSu366BUlmClIlZU35pZk7mfcMhrLpawL03I155x0I0TqDP5SjhPR/04QojQou+v hN519lxJvXNq9OgDtRVD55pbpJtiiy92JQKy1yKkh2ak44bfuuaN+rDI8jPkmrMcSlcE g10i5AKAtewp1S+GROKa5/1pLeFlpuV9fqw83gAb1KOLbfoK+a1fGNGJ1X/NrXNiCPr1 Q2Oy+kMqd8ZHIvG5DQA695SLXmEhm5LphUFw4ICbMGHc6LycQf6kxlPJSX3MSgfNVmIa 77hA== X-Gm-Message-State: AOJu0Yzh1v5DXCtagQiVL5oDs5wLmpbH87vKoSIT7YbRB6znemS5S5Qx BLRCGJafq5zFS8AGrCUqWFpHJStchvO399s5xNlXHHBi0CATbzsO X-Received: by 2002:a05:6214:2527:b0:68c:7302:8974 with SMTP id gg7-20020a056214252700b0068c73028974mr4680152qvb.30.1706893636113; Fri, 02 Feb 2024 09:07:16 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVzE9W/xHwkhE7x6DjMoApkSYNkXT+2USzaZmjbS3sbgrF3DuuvI/47O2BvF8T08qBw49dxUuhmo9mZIxB1R1AxE4SDiNufQPx9s3iaL6qXyXjpVAe2Y95NnjECfXFS2WA6RIj1XgpClJ30LS65jR3Qo5GlDtlZb5Mk6g2qD1nm33uLFV8d2OytNhHfS0VrXysm0MD5skLE89Da8kxRkxTj/85Es2in21h4yaesgvHX/zuE6yZytjMDD7t4F1H+cw54nL1Jxi9eXUV3zEEAf4uWp869RVSbUr9m1na6vIBBbkDXp5uFVQffYvbizP/7nj8OakHwc8LKkpt2Mbi5hqnMGME7H3dNBA== Received: from maniforge (c-24-1-27-177.hsd1.il.comcast.net. [24.1.27.177]) by smtp.gmail.com with ESMTPSA id mf5-20020a0562145d8500b0068c749df8f2sm969308qvb.20.2024.02.02.09.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:07:15 -0800 (PST) Date: Fri, 2 Feb 2024 11:07:12 -0600 From: David Vernet To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, kernel-team@meta.com Subject: Re: [PATCH] sched/fair: Simplify some logic in update_sd_pick_busiest() Message-ID: <20240202170712.GC2238525@maniforge> References: <20240202070216.2238392-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-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aaczLianmhiTpaH6" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) --aaczLianmhiTpaH6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 02, 2024 at 06:01:22PM +0100, Valentin Schneider wrote: > On 02/02/24 01:02, David Vernet wrote: > > When comparing the current struct sched_group with the yet-busiest > > domain in update_sd_pick_busiest(), if the two groups have the same > > group type, we're currently doing a bit of unnecessary work for any > > group >=3D group_misfit_task. We're comparing the two groups, and then > > returning only if false (the group in question is not the busiest). > > Othewise, we break, do an extra unnecessary conditional check that's > > vacuously false for any group type > group_fully_busy, and then always > > return true. > > > > Let's just return directly in the switch statement instead. This doesn't > > change the size of vmlinux with llvm 17 (not surprising given that all > > of this is inlined in load_balance()), but it does shrink load_balance() > > by 88 bytes on x86. Given that it also improves readability, this seems > > worth doing. > > > > As a bonus, remove an unnecessary goto in update_sd_lb_stats(). > > >=20 > Given that's a different scope than what the rest of the patch touches, I= 'd > rather see this as a separate patch. >=20 > Other than that: > Reviewed-by: Valentin Schneider Thanks, would you like me to send a follow-on series split into two with your tag on both? Or were you just letting me know for next time? We could also update this check to only do a strict greater than to avoid unnecessary writes, but I figured it was preferable to have no logical changes for this iteration: return sgs->group_misfit_task_load >=3D busiest->group_misfit_task_load; --aaczLianmhiTpaH6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRBxU1So5MTLwphjdFZ5LhpZcTzZAUCZb0hQAAKCRBZ5LhpZcTz ZCd1APsHJ+HAuY/9jG+onEyWQ4qCDcfvGlESj1ixqg+mDd2ZpgEA1Q0HN0+A5vXi LLt53N1JFUeN7fCOj+uzuP5Rh5G/9ws= =fzh1 -----END PGP SIGNATURE----- --aaczLianmhiTpaH6--