From nobody Mon Feb 9 21:28:10 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 797E82877DA for ; Tue, 13 Jan 2026 07:51:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768290693; cv=none; b=jj8wmi1YqiiyTRJ8IxE2jFs9Hw94lTflh61GybiY5QhCui5M0bQFe7iqnd9B16EL8KpVNSvDcOUyhf3FjHHyUJxlEbaT3w+zKiiQRpLX58VFMXxqQYsza4Eh4qfSxlYaLu6KJ48hpMDXGLjZg9dfh+U+SPRcoSBcoIRwKx9PRGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768290693; c=relaxed/simple; bh=FQMC8u7WEfHi2e7m6b7ZwYm29bKdPaoAo+fPwvguazA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=j3WDsD2HwmYwy+NYqr/OznAcXwBoPWYjeSXo1BL7/MG4OgiQTenEpbMzHR4JEVmrLR84G60bZiHWmeWkrOmCr/QebM8r7ZzWI2L6JHWxLRiaL1pYDFzJjCUYa+Vm0eypQi7IMR0DU5i9oogSb2S4OEDjN8uLRmuSjK+A6l6p2jE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: a77b998ef05411f0a38c85956e01ac42-20260113 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.6,REQID:a4e918ad-b411-4257-b74a-7ff3b8b3a571,IP:0,UR L:0,TC:0,Content:-5,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:20 X-CID-META: VersionHash:a9d874c,CLOUDID:45d2477b6e2c797804e7b6924f33adee,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|850|898,TC:nil,Content:0|15|50,EDM:5 ,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV :0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: a77b998ef05411f0a38c85956e01ac42-20260113 X-User: fangqiurong@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1347166411; Tue, 13 Jan 2026 15:51:22 +0800 From: fangqiurong To: mingo@redhat.com, peterz@infradead.org Cc: linux-kernel@vger.kernel.org, fangqiurong Subject: [PATCH] sched/fair: Move WARN_ON_ONCE to more_balance after dst_cpu can change Date: Tue, 13 Jan 2026 15:50:51 +0800 Message-Id: <20260113075051.3959560-1-fangqiurong@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The LBF_DST_PINNED path may change env.dst_cpu and jump to more_balance to restart load balancing with the new destination. In this case, we need to verify that busiest !=3D dst_rq to prevent attempting to load balance a runqueue with itself. Signed-off-by: fangqiurong --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5b7523242..5810cf882 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11777,8 +11777,6 @@ static int sched_balance_rq(int this_cpu, struct rq= *this_rq, goto out_balanced; } =20 - WARN_ON_ONCE(busiest =3D=3D env.dst_rq); - update_lb_imbalance_stat(&env, sd, idle); =20 env.src_cpu =3D busiest->cpu; @@ -11797,6 +11795,8 @@ static int sched_balance_rq(int this_cpu, struct rq= *this_rq, env.loop_max =3D min(sysctl_sched_nr_migrate, busiest->nr_running); =20 more_balance: + WARN_ON_ONCE(busiest =3D=3D env.dst_rq); + rq_lock_irqsave(busiest, &rf); update_rq_clock(busiest); =20 --=20 2.25.1