From patchwork Sun Feb 4 04:46:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vernet X-Patchwork-Id: 196421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp197158dyb; Sat, 3 Feb 2024 20:47:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEtgyCZObSSOpb74mPaXoFfKxn2ewnOO7cVgdqVmgcEdDwKIend77mIht3oIUb4hdr4Ou5 X-Received: by 2002:a05:6808:28a:b0:3be:b0ff:6bd2 with SMTP id z10-20020a056808028a00b003beb0ff6bd2mr12990246oic.18.1707022029254; Sat, 03 Feb 2024 20:47:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707022029; cv=pass; d=google.com; s=arc-20160816; b=L5a0e3wYJ9YG9i/WarHh+2hagWdCSfjmMAwUHbxtSJ0qq8nBRpL4uXwMDuEU11EjJw WAtaJ3o0MgDyefdogTKmmHSSolZPKKlCOfVlV4mBWghPAZKKsTnGSJiUNqVyWv9dzd7s I2BsdFK8bdSdiGHoOeFtshLajQ4wLc+yC+8fRqgkY7rv47ig1wqwLlc9CzvprkY1NmmM qHznqRGm0mkifU656AkxwJPXsr3rQbJAcTVeFXlzH/KmanOWQJ3cH20q6RcCOASTzrKP gvtHqgCE0UgfaduWugiAkcc0+WXbP0Yt7Y8AE91fVs0LZI03Y/tA/ifU/9tVAmma4Ejr s3Zw== 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=hTl2D4iOo0GV1DAY/ZjWEvwTNDLK6aFt78YqxSZPvBQ=; fh=7GUUgpBHtlll6dqZeo7ODzHMe4bK0QH8a9NLdBeo7Ek=; b=WAPuZPyxGvW1QWN1DGcSiI9gBSzKp+IOwCdPnrCDpyRu9YGWD0pfH8OrJBOgyC3I8S BPiNlG3UQEJOSHAjMN9/pA/OQ5kp4dnnA2ozorej1utk7ifDKeOXkfPI18Fs7dJwC640 +xIZ4rXu7Nsa4hBkvi7ByBLVYube9gDpcek1IwjEW/ImvY3YaGoLwSCdxc1YA1tKQA7X 7O40nJSdo7SALq5Hr6Fm/G0/R8sJNYj4ALoOJqlPhTPPza574KLLuS31l/qu4w7CIp6I Y/q8CXSJjyyXGcUdH9OpJgvXIt2xm5Mmd/4qPxbJrDUitTg1+fyCLvay+bxb8IK7LHZ7 T2Gg==; 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-51427-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51427-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXTkVbLUX2Bof328RE21pZ/7c/pt6jh4mGMv+EUYU8kdpSl/TM2x7UHFuWB1vicGjwN3Kg3hl12kbS/KX/VuX5GQuX9zg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p4-20020a17090a868400b0029663cbe716si2041830pjn.72.2024.02.03.20.47.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 20:47:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51427-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; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51427-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51427-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 07EEB281699 for ; Sun, 4 Feb 2024 04:47:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAA43A939; Sun, 4 Feb 2024 04:46:38 +0000 (UTC) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (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 89F586FA8 for ; Sun, 4 Feb 2024 04:46:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707021997; cv=none; b=HPbpDryiNI7SidDvWt9nZHv330871qsryTIYGSLGPTasddOvNO1xMyldweUFklKFfK6jJ9/SruapIW+TOfC84fI8/MtOBtREeDQHm8bvkmIMDd2uhpjs8cxNGa9AZcGIUT57zDBYeyn4gANzyd/q3yWRFWkgrzFibf7iRPnzDzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707021997; c=relaxed/simple; bh=esJff9D3QxDKh73OdhoQpybzSp8tl3pv5yUOn5L2Or0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oPhyZx6BCcBjOGiOILtAU3t6dFBNB55ProfJIs41NTNWLD6DurfB19PdRnJ38efnPDiLkIR7J9lN2OtL4RyDfiZQugQHPmt/o7MoYP6thcLsD7xkM0azVPCdOXXT0Elz0UVomfPEa+eQn42o+f4KYreqyB9DObuIT1meMmY2k14= 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.222.172 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-qk1-f172.google.com with SMTP id af79cd13be357-783ef8ae70aso247544485a.2 for ; Sat, 03 Feb 2024 20:46:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707021994; x=1707626794; 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=hTl2D4iOo0GV1DAY/ZjWEvwTNDLK6aFt78YqxSZPvBQ=; b=C1Z0tjsMTcXNvyQ0l4P5j3ERERGxJDEWDAe9WaVgxYx7sZ2fKD757JmlTu6qFT35fv HI5SsLeWyU+aFld7AgQpL9bXE8rjgnHkeFNX1DssmcMQkoEYnCInMxex2OvnoRRg9EOb VkyK1gJpd5ktvMYAeZ1i9BOBfpZLOwPIVPCnwWoyGC/j5kOwOQznNZzlqAM6TwLD7+pv /AE65wFTbm2lY+ImoWwCdUgLJGRQcey+cZgpm8FgbarkJgL2mSeBX7y76h2ocfWKPT3t edm5JbqZTFAvOVoLKXrU4bkpmt9hdtTlczUwst2N93dSi+dXJbkgtusuni2UiRy+Xkgk C/xw== X-Gm-Message-State: AOJu0Yz9SDsXM7gRj44wfxhmH/pyGXy+4+vWtxS5K6MO01qa5WHV4pDY p5XshD+0CUqQRHVoeRcfSjdnD1sUTZ7vjAzCDkqrW2NU0iYQbsrRuUXCRlZu9Y8= X-Received: by 2002:a0c:e082:0:b0:686:a185:dc11 with SMTP id l2-20020a0ce082000000b00686a185dc11mr2339381qvk.55.1707021993889; Sat, 03 Feb 2024 20:46:33 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXEw3NEGoax1wKTMcPEjLAOa+mI6JFt9Fn9dr/BacCCq/KLmBIwJglX11ETVmzHeqLm7qluTBvMjTx5KBbBEH0DMJPk25rtJEbif1AowmGxrK+a4z7BcUSxCyG+3mL01bcsMIBa5JkJ6gDplxUMnmB0FLMflqp7e7ggdpiUgx8rdVJPhJXXKcehp1s1+Nkh+bNs71h9J4th8kHpGOjm8cL7QoLc8hokaQW3GFcDmy9oqqsSug+rvKmpt/7xvkfig5eY9dcbLb1TE67qK+kncPpzAb2KoZnbh/samfk5Z2puv4O+FH/Cyw2KoZSG3ieGGeSWN1w7f1/sg0uQuZHjMZsKHxna27YLbiaX7A== Received: from localhost (c-24-1-27-177.hsd1.il.comcast.net. [24.1.27.177]) by smtp.gmail.com with ESMTPSA id ny6-20020a056214398600b00681785c95e0sm2434781qvb.46.2024.02.03.20.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 20:46:33 -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, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, kernel-team@meta.com Subject: [PATCH v2 1/3] sched/fair: Remove unnecessary goto in update_sd_lb_stats() Date: Sat, 3 Feb 2024 22:46:16 -0600 Message-ID: <20240204044618.46100-2-void@manifault.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240204044618.46100-1-void@manifault.com> References: <20240204044618.46100-1-void@manifault.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789942331187453066 X-GMAIL-MSGID: 1789942331187453066 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: Valentin Schneider Signed-off-by: David Vernet Reviewed-by: Vincent Guittot --- 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; From patchwork Sun Feb 4 04:46:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vernet X-Patchwork-Id: 196423 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp197549dyb; Sat, 3 Feb 2024 20:49:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPWMRp59zzgd5kv4zOZsnnl8ePg1Wo2N3En7N4riNR0tgE6qMmKuFiIohtsDzAFPVwnl7M X-Received: by 2002:a92:2910:0:b0:363:c61d:3ad5 with SMTP id l16-20020a922910000000b00363c61d3ad5mr485329ilg.26.1707022165372; Sat, 03 Feb 2024 20:49:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707022165; cv=pass; d=google.com; s=arc-20160816; b=x3tK2Nxq/TgOMvEcLsRBSICRmz2WFYRx3AkMbcGY26YYgXRTyyP3j1bPo9+uUJxB/t lPXxIZ60DtMsul0rZmtz1Hm7C3l85tN8u7Bp0S3aoFBftaCVLRDN5GrW0DpDeClgrys6 92/3peJTRl11rm0OH5LiO64Zuje+WM5D5n6Aa83JOwUwsv5qiAlOrgOUFaOuFgAWR8Zx XpuZsKbiuhK4PY1vYRcqFxrjQjY+AGoiaQ1MjmAfoLVr/BSsXF2SOVhvuUjwjDWFzn9b hCOGRJvP+B6YyiJOQ9N4T41jQyi+5nXgLzhIhC/Li82QjMUq2aA6qhwKfmeYAZiT2Hg+ MTIw== 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=KQTMIMuLSrSdNFkBQ8JACN0LFlSoVQIArYjoabFjhtU=; fh=JB++KzZNnBVIefR+9bs/3rj7i26nOd+0uwurG/DMw5o=; b=DcsyMLcUsEONEMlbqXuCv07y6Di9gCoEef47zV8hcEf5xOF99DT9AxvSZdQolK4CI9 afDV4z1tt4j60iU8jr2c/711ZCV9/FTTL6n2sD8MsZ47P79xrG9skyYFcJdkZsYa8WUO DRtmjFbGftb6VQSrikCLfILEyaUAqegZJlMyD7UvaX8wdROs/uatMB6kXuK/mqXBbqMz 34Ti0aM110SZVukjpTLA4lW1il7v0p6Xy5c0oXQpEx4IXR4seK3R9MpyM9SlOwSQeU0z vMd4bCDyusr6+NexIxEsnKsZoaIRVtdxoxswFsXt+gw393Y9DmsZa0D44m5rVlwQP2Ua Mxng==; 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-51428-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51428-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVtNOaujHjw6tqluJowlk1yQ7rGbWWS8t0loYNmcoGyEd10KvrAbBTC63+TfY7eT4wWiN4Zd6DyI2OIYrXfpowqO79mVw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l10-20020a170902e2ca00b001d937c12c9asi4116654plc.426.2024.02.03.20.49.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 20:49:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51428-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51428-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51428-ouuuleilei=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 2D6B3B2629F for ; Sun, 4 Feb 2024 04:47:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86104BA29; Sun, 4 Feb 2024 04:46:40 +0000 (UTC) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 3FD6579E0 for ; Sun, 4 Feb 2024 04:46:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707021999; cv=none; b=mHfvmkjHC/PIiMUoc6Dd+qd9DUW28aY94Ys3mDw2H/Al9kf4BQ7EbAQxSnK/SoIatKAPULcAHfu68QdUjW0kDkME0oLBTqTA/lrTshY59ssmzjewJdBbJrbHhhStH0XcBI5ZeT4Tr6ioe5tv2hDaSmnTl40/bVlW5149lQXkAfI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707021999; c=relaxed/simple; bh=vui/RYMxtvLSlzIZx1ihMqsZNVVUacQvQp4BnYDnMfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q/rZ0pWLRwWm+rGqxB13o6qGEP4UV9gmqVMfAccGiiQXWHGs3i6GZmHvHFOxOuw2kOZb+3UyEJqtO4IIQQt6DD7VAz7Wuh4h5GRMO/gNA17yPlxwD04b3opgYleltUqdSJzKt2Zb3zIWqILU4P/BjCv0ygKJ/sYMjNh6bxM0ZKg= 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.222.169 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-qk1-f169.google.com with SMTP id af79cd13be357-783d4b3ad96so221592785a.3 for ; Sat, 03 Feb 2024 20:46:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707021996; x=1707626796; 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=KQTMIMuLSrSdNFkBQ8JACN0LFlSoVQIArYjoabFjhtU=; b=H1aRUYjTjIvs6E1cO0QMg9tm7ilcpa1Evq0TKdSIvxGlmYdDCQtyvn4/wHndkt05gJ HyBN8oQ79SnVj1XlWLpbPfaIqxTMvvedW21c55HQw0MoxlPXXhqIxOt+TAX4GaeCg/yJ BMpiALOFH2Gl3VD97mbLsGiF99MuTQ5Z6UA4UvoZCGhOMi8t428LZjyZ0PYZ6k7au85Y hVsz42FWHhQxxkj/68MLu2tY0UHu2fzSsGZcHAkjq+cKs+fnrGLcFK2+MB95EaNNf+rb i0/YYPzMw9MdFDKpxeFut27jYSYaI8HHTNd0gwOdLQj5ZhsPmJRlBabyBBUTVOEhjbWW 5hmQ== X-Gm-Message-State: AOJu0YxbTYvPkgkYFGN5Px+p1hOVSAZ5lV7R+DPIBRgDMXCQt+alLivG y77cBqxlF7DGiuO3s8AePuGx2U2jHjxvYftOkGBvAoXFXBXeJxJRLMmIjPZpaO8= X-Received: by 2002:a05:620a:1211:b0:785:3abd:ce51 with SMTP id u17-20020a05620a121100b007853abdce51mr6774160qkj.58.1707021995706; Sat, 03 Feb 2024 20:46:35 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWes6Z47uXeC7KAMZiu/aOWDJN7lH4ycbqLnWSbxMmv7lO1Uvkm+VjGE+ykgfVR9R7TDBROhV3KwNYNshSMZBtmek9J+FklPq4njOuarTeYHCPrE4P30x4PsA20HrRBvRMVWX/2bRct4H4YvQuISR5V3ugcnzcsQ8L1wq3rCsi+l38fxkLHL2DKeUEfn6AukBfsexhqA8KmWb4j/Q4jDCQwVbDBKTdPnfWsesQog8Y/u3j8nH80elmDb+ZxP83pv6YAvSwP3DdiVilq7eR4xWtStLEnvMQfF/WORBlPVJYapy9xMCzITpH5iZd2LJVSohrnI2hEJmX2hojnEM94CSojXwnA5pVx3YbyLQ== Received: from localhost (c-24-1-27-177.hsd1.il.comcast.net. [24.1.27.177]) by smtp.gmail.com with ESMTPSA id h7-20020a05620a21c700b007853eb72c49sm1925688qka.46.2024.02.03.20.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 20:46:35 -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, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, kernel-team@meta.com Subject: [PATCH v2 2/3] sched/fair: Do strict inequality check for busiest misfit task group Date: Sat, 3 Feb 2024 22:46:17 -0600 Message-ID: <20240204044618.46100-3-void@manifault.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240204044618.46100-1-void@manifault.com> References: <20240204044618.46100-1-void@manifault.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789942473754951602 X-GMAIL-MSGID: 1789942473754951602 In update_sd_pick_busiest(), when comparing two sched groups that are both of type group_misfit_task, we currently consider the new group as busier than the current busiest group even if the new group has the same misfit task load as the current busiest group. We can avoid some unnecessary writes if we instead only consider the newest group to be the busiest if it has a higher load than the current busiest. This matches the behavior of other group types where we compare load, such as two groups that are both overloaded. Let's update the group_misfit_task type comparison to also only update the busiest group in the event of strict inequality. Signed-off-by: David Vernet Reviewed-by: Vincent Guittot --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e7519ea434b1..76d03106040d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10028,7 +10028,7 @@ static bool update_sd_pick_busiest(struct lb_env *env, * If we have more than one misfit sg go with the biggest * misfit. */ - if (sgs->group_misfit_task_load < busiest->group_misfit_task_load) + if (sgs->group_misfit_task_load <= busiest->group_misfit_task_load) return false; break;