Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2815543rdb; Mon, 5 Feb 2024 20:40:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVCSscBz/2HY49eZdah020AFs9xr8GHVulWFWgJy89ZEsFJ4aUA5zfb1D6Jih8DuRS0Ti9 X-Received: by 2002:ac2:53b6:0:b0:511:46df:7ef4 with SMTP id j22-20020ac253b6000000b0051146df7ef4mr939621lfh.22.1707194402499; Mon, 05 Feb 2024 20:40:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707194402; cv=pass; d=google.com; s=arc-20160816; b=oosbIkBvJOFW/d3aEPCa1oZtI1vr7u+WT4Tfxg9GKhsVGpL5pqovLb7kgUQPoFcEQI bhMKNWpypPw8ehv8FAEuWbdqkvjflSdUb/O3BeQ5y81WjGbN2HSEVEfPsg0FC2M1hF2U nIE0I+Kj6b5UiRHqGZ60Ro4N6zSA+7XDymKVO6UHl+hsY1mJVhsTc5ZfNYyrmt3zuc8a /09m7Sh7OvctiB5V3q7jUrtzZgCqV+CA8zEOX0AxG2Cgp8pm9pzbznII8ivilMmt2nYm LyWr//5eyT/14hwFjlB5ePRd/gTTFIRffoLfDeCB7uHER14yD+1sN63AiYVj0Uzdp0+K tpqQ== 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=TIX6iuoRN440ik6kRv9x9Dd8FfCsaf7euCk0kuQlv08=; fh=Aw2H0KUW7Ppn/YcDar7/7zphGF0UgUsHpT/dcVuVdq8=; b=nGGL78rSqnjNl1/hvOp91zRO+581pVIgPG/4mpHdl1FAMwNStUhi4Psuavol1h67/y z7B7b0dVgKXezJIT72//sR2NVqMlpzeX4uLQ+UaRkhi+mjwir5aIMPcWvvAKYMS+7cwg Tp209leY6lgzBVnMtN8CmH/zVg6UmY9WrdrXuQGF2S5W8UBchdBtgWyovBPCLrD/PKJ/ d/45Blf7g69Ah5zILUGz3D9IyqtseaxlkUKgr973F2qMAdLIezND8pXuBsT5jkBKxQ7E 1TM7sCSBKD2Drtz5wwMBFECBaY4gEwUiWt5l9xWjQKaK2+MRl5UR38YLi9nOsL8Q+ed1 MVWQ==; 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-54319-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54319-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXjYYbL5m+A+vqGe9is/nhRHJh3e0S5KpkKYSOyG/hJ3I/6GySNhxGbKA/6/bHl2rPxRiiIuebOrvYvVNz7eyQK+nyuhzoSvq3w7QfeAw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jx10-20020a170906ca4a00b00a366a6e72b4si622135ejb.715.2024.02.05.20.40.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 20:40:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54319-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-54319-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54319-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 36F1A1F22CEB for ; Tue, 6 Feb 2024 04:40:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11B377C08F; Tue, 6 Feb 2024 04:39:32 +0000 (UTC) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 F1A8978B5B for ; Tue, 6 Feb 2024 04:39:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707194371; cv=none; b=JeqMDT9e8G0/zIVVE5cDJrM6Lsf/V5HKsrpbkMyJq/5UHsSx4z4zT0kVeW5f5GiRMenWKIUnmR5UtGXY2F1bj7nsgDce7xLvAu0Mmg/JaDKYeUuMZPXKL7+4rIc/M4BYW+uSIB2jdKxsnOyo6bFGUp3apa2rzREwS8JogVsqluE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707194371; c=relaxed/simple; bh=/yBd5sGe3byMVW8sDxeCS54/0Z37uF3CUIi/XstrLJo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KNFeIEaFF1CGbCmfB+gkcLphhDk7UcYNlrLgKARIG6aNySiIs22VOaZ5o2KZLXpeSrTS+keFPXhzvOEfBx0VrMW8/0XJgnoB336yDS3xzWipxijiHPeiXBRgv7ji7h2HDK2t0XYZs4u1YVrKharmRw87dsuFefyaWIx0ALEdscA= 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.180 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-f180.google.com with SMTP id af79cd13be357-783d4b3a026so306313485a.1 for ; Mon, 05 Feb 2024 20:39:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707194368; x=1707799168; 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=TIX6iuoRN440ik6kRv9x9Dd8FfCsaf7euCk0kuQlv08=; b=JjMw7DZ/Zem8tGI1B287dMck9mLtWnBuqznI6w94CdMI5bm2Ve6GsP+ODJYCWRm40h m7UrxRWdc2BRR+dsH2Zxo+s09SJQzZ11zJxS0gPDGWG+ear9koUg2kuqrlI6vNpAwjS0 5Cd7JEts4H1ihCkTVsuGP0PvbQA8iIJPS2GnuIdhhNQsKHbacicCcxgSexlaLMWij0YB miJfbSD3djqTAQrkDj8Xb9rdMaqp6A/fcFfoHI6xSfid7iX+IyXuXuLxdFemr2a4MHjr wdjDXw1wZ0ID+xJjXCXSsmFQ9EdZpfp/nKFo5bcpYxd/6L0bmVlGCCSKanAa2tk2dinb wGhA== X-Gm-Message-State: AOJu0YzZ/kpp17aHjTWPsXF/l6qzTYa9gWm0r8eBTWiWx3FdmCm+M+k6 61FnaiLND3H7Z2csctWg3yJWD6qwnMo5iXRA27X/n1LDScNttdgU6uaE2GOZciqqZQ== X-Received: by 2002:a05:620a:b8d:b0:77f:8a87:ebfd with SMTP id k13-20020a05620a0b8d00b0077f8a87ebfdmr1060218qkh.41.1707194368565; Mon, 05 Feb 2024 20:39:28 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUgawVg/8epGHYSQn5u9fEP0+FbcAkJEsMGMiA1exxndl2m3HCeu+0Oih2o/j9ee/jC741kzplIXOUSpbHhojMejoJN/wdRAPsrBnE0BhRMWwY9WAIbpg/mcuunBJezmBwiiiIdegzHULCnUpVuyDgqD1o3Vya+cd+Pj9EtXhQCTZEtil3/aMUha7uZ+NNpRbUhvB7aMfgpGP5Cjb/0gtNagl7pT1yLl0LrxYNs7V+F+TpQubS0KO91RDnCRHG0z6uoj6v56agPFuwkLBT2CoOJ9I6/rhHagU/k/oRTAXQ4fMM/q04= Received: from localhost (c-24-1-27-177.hsd1.il.comcast.net. [24.1.27.177]) by smtp.gmail.com with ESMTPSA id f6-20020a05620a15a600b00783749b0d2fsm577757qkk.94.2024.02.05.20.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 20:39:28 -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 2/3] sched/fair: Do strict inequality check for busiest misfit task group Date: Mon, 5 Feb 2024 22:39:20 -0600 Message-ID: <20240206043921.850302-3-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_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. Reviewed-by: Vincent Guittot Signed-off-by: David Vernet --- 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; -- 2.43.0