Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) (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 9C5623515CA for ; Sat, 15 Aug 2026 11:04:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786791879; cv=none; b=e/Xjk5o3fDe5xagcDo1zag3Ndr81tBydAD7oc85yHorO/I4WUKxDYjwYXdHH7U4TDjhMbHmy+Z0yMTxLjMXrg8Q4LycsgTpQFgVvo6WNONqhF4/WtALCLTSo4MAPiMXGRHZgkBX43DWVaMzwXynvRHFbSIm5g2ZG0uL7oS3pbOo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786791879; c=relaxed/simple; bh=IYwCHGvRCE0IUY7GbipIBjw2hj/OsJ7eLxHeg+OkQyg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UgwQWSuDzRQeYRDbid6oZtergsWsd0poGtR80DygOFjnBxv7/rvVo1tdxzBXldPRS7Bsw6WMR0Qz/mLGeSqtNixIIZinMIJnd3ThXHo8/cP5xRTnACgINPsXotZzlKJb2r9xBiK05Y4ez1fGy1txlD4TMpoIlC6VOe8TC8t6wmU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=kyae3sY4; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="kyae3sY4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=wn OvNfyp/TALdwlgN291rg+EW9FopoczSlJR5mBkWNc=; b=kyae3sY4fEVJEtOLLu jUfITjLl32BjStj/ozGPShwhWwtw3dlxssl6vIsH5HZcIVXig+pQzjj2vw4ATtvG 3voSPqwe/NEhs2p2iIvhvORcupXyc7USP54EOirC32d9SZzJ3hADceezurTWr15+ nzuvq90ET3CIWNvpHaJILwpSE= Received: from zhaoxin-MS-7E12.. (unknown []) by gzsmtp3 (Coremail) with SMTP id PigvCgB3tQRjR4BqOFTVNA--.50445S4; Sat, 15 Aug 2026 19:03:03 +0800 (CST) From: Xin Zhao To: 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, vschneid@redhat.com, kprateek.nayak@amd.com Cc: linux-kernel@vger.kernel.org, Xin Zhao Subject: [PATCH 02/10] scbed/fair: Remove duplicate check for busiest_cpu in active_load_balance_cpu_stop() Date: Sat, 15 Aug 2026 19:02:49 +0800 Message-Id: <20260815110257.124354-3-jackzxcui1989@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260815110257.124354-1-jackzxcui1989@163.com> References: <20260815110257.124354-1-jackzxcui1989@163.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 X-CM-TRANSID:PigvCgB3tQRjR4BqOFTVNA--.50445S4 X-Coremail-Antispam: 1Uf129KBjvdXoWruw1UKFWxuF43KFyrZr1kZrb_yoWkZrX_ur nrurn3Kr1jvFn09ws3CrZ3Xr1F9a4YgF18G3W0gFZrCry0qrZrKrZakFn5Xr93W3yIyFZF vwn0gF1jqw1DujkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRuiiSUUUUUU== X-CM-SenderInfo: pmdfy650fxxiqzyzqiywtou0bp/xtbCwAelr2qAR2dxhQAA3z The check for cpu_active(busiest_cpu) already ensures that busiest_cpu has not gone down. An additional check for busiest_cpu != smp_processor_id() is redundant. After this modification, busiest_cpu will no longer be bound to smp_processor_id(), allowing the active_load_balance_cpu_stop function to accommodate more scenarios, such as preempt active balancing feature that will be addressed in later patches. Signed-off-by: Xin Zhao --- kernel/sched/fair.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 13e873b1ef58..11c104010b2e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -13769,9 +13769,7 @@ static int active_load_balance_cpu_stop(void *data) if (!cpu_active(busiest_cpu) || !cpu_active(target_cpu)) goto out_unlock; - /* Make sure the requested CPU hasn't gone down in the meantime: */ - if (unlikely(busiest_cpu != smp_processor_id() || - !busiest_rq->active_balance)) + if (unlikely(!busiest_rq->active_balance)) goto out_unlock; /* Is there any task to move? */ -- 2.34.1