From nobody Tue Feb 10 12:43:24 2026 Received: from out162-62-57-64.mail.qq.com (out162-62-57-64.mail.qq.com [162.62.57.64]) (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 1869D1D89E9 for ; Mon, 6 Jan 2025 09:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.62.57.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736154141; cv=none; b=aAzfEZiyT66o7sOT74NuCwMGpQ7HLYh8U7I8Gilp3mXSWJ095sTtVzPkU45Ntm9h5ZopzHJmD5qHYzUKDB4id5ZG/2/hCfxcp+TMavg2CAw+dnreOxZZyV+JGvhPuKhrq1yci1GbxvS9MJUi7BhiLU50Tq2loXQwmF1CcvJ/3Og= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736154141; c=relaxed/simple; bh=W2xbZ2rTozfZ38hOOftiMMHstQHX/S4z1v5Ce8Ry2Zo=; h=Message-ID:From:To:Cc:Subject:Date:MIME-Version; b=UofZj43Rsfg1OOIXI3s/BOQ78ABlpX1QW1ywM4Ez6phfECwTjGKmJVCCS50bXZ6x8/gXyT9ZjcXX+tREcxTiLziYcWy+DZVT93EfBBczso3OYAE4kkY3KuVHaqsubKNYNe7PSWwhSwqlSCBLTgESweGVvyqRHKBZkyHU/AlGglw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b=bizx/0vS; arc=none smtp.client-ip=162.62.57.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="bizx/0vS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1736153826; bh=7vsZomXZQHimeKfBsiqFer29hHr2eIHoAQabxfsmnHg=; h=From:To:Cc:Subject:Date; b=bizx/0vSxg2hLlY6rmd6eEVRQFmtveS01jh622rAb9VqNi8TobXrxRm4mnbeCxt4p SloWorIFCRpUDMn5HG0V0/COrp/Xa+bkRzEJ0uZdXrEkgCSmkUL1rcejAlpsdtjU1w y0qlyEFU+St2DhCFI59XEyuUH91z0vw+1kDJA0Ho= Received: from localhost.localdomain ([101.227.46.164]) by newxmesmtplogicsvrsza36-0.qq.com (NewEsmtp) with SMTP id 8A9B849F; Mon, 06 Jan 2025 16:34:41 +0800 X-QQ-mid: xmsmtpt1736152481tqmr2ecym Message-ID: X-QQ-XMAILINFO: NGZp1yYNf7Y+C2hqOaLWm6FK1AnucDKxaW1oeN/swzQYuTFz/4mIHqdeEZGWF7 /rn6ao5yf1O+n3Gx97QOaiZqeE9zcdbIhkb1+xPC0ghSkD9u1PsPBVw73ep0zRwltUyZL1yWWbUT rr/gJRtI1y88z54G5klf0vRGlJjXMfdNr/BKhUXLbl6pN1+Rk/gUfWvAv8Pj/CQNrdRSzWaIV3Bx XLG4Y7Zxot6mmttms3wgi7hLFjZoHf3K4BNqB6IJnDDF9e1TrEq8efidu41bgEklDbLsUsvxjbT1 FwGl/pZiwrYYfPBEbnPJ3GZRlsZ137tgb/Eld8ucXeHpq8YlQ9Dd6Qo0WrOW8S+2sGUZTSzAL1PA KR8cvY6uYdIxUjt9owyRCZfwUMrf00uJWI6L0Q/n0WHxdIX3G1nMdn8RkCSUc+dhpeShEIhLRvDI FQ8b9m+kNY0Zv3nrqsL1T27MhVsyAMBFbgdj98irrPnnRYU0dkFyvgkj3mTRMnu1NbV5ncrtQPcB K0A7Rz15wxORtADzh68gp3WukfC+ycjWcOVoWFONh9CMIWE1uuJbIKlDRYpFNhZ6CCQq+7lvJ73d ShItLRF1I++cCk11YK8n3QHrg/yFo96lutTPVSjERN9j4Aa5fqPKZ5pD2oLWbLzFwbHg9GhWqNQW NDaRWWnHV8pFzPw8h+1u5OfZuqIXFt3iAu3Xgq6QMqa5WDeL0jlYmYKSlmZUMY9NiS6DL7vNWBZ2 Yr73bDn5zzITXuhRNROPEd8QzhvG7RfDR0bCcYtQSCH7BvkjEnF/fh19Rm9wpGYBk6JUbbnYUVNm 800AGBQKoRBU+zqHRvk5aCUGti6VaMs2514eMH3yNTa/GDiMWFip+YNaLKth+/A/6J3p0xiHnaMb aU/y8oSx7WbfKSSQHq6/03MaQIBWK7AQ/1LLC/tA5rqacmeDY8LW1ldnuZxZDkZZ5ChscA/kFdWC MH30jg5uvmAM0sauk0sKAq/ZP0M9iI8RbXM0NVHuuIKZiITCz0MB1hi5edYEfoTXXSjyVde7Gli5 MZy4per/9QOvKvoGV8X3DE2f7nHAoh6WFp9H6htw== X-QQ-XMRINFO: MPJ6Tf5t3I/ycC2BItcBVIA= From: wujing To: realwujing@qq.com, mingo@redhat.com, peterz@infradead.org Cc: linux-kernel@vger.kernel.org, QiLiang Yuan Subject: [PATCH] sched/fair: Fix ksmd and kthreadd running on isolated CPU0 on arm64 systems Date: Mon, 6 Jan 2025 16:34:40 +0800 X-OQ-MSGID: <20250106083440.88367-1-realwujing@qq.com> X-Mailer: git-send-email 2.39.5 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" This bug can be reproduced on Kunpeng arm64 and Phytium arm physical machin= es, as well as in virtual machine environments: 1. Check the number of CPUs on the system: nproc --all 96 2. Add the parameter isolcpus=3D0-85 to the grub configuration, update grub, and reboot. 3. Check the ksmd process: ps aux | grep -i ksmd root 502 0.0 0.0 0 0 ? S 10:00 0:00 [ksmd] ps -o pid,psr,comm -p 502 PID PSR COMMAND 502 0 ksmd 4. Check the kthreadd process: ps aux | grep -i kthreadd root 2 0.0 0.0 0 0 ? S 10:00 0:00 [kthread= d] ps -o pid,psr,comm -p 2 PID PSR COMMAND 2 0 kthreadd From the output above, it can be seen that both ksmd and kthreadd are still running on CPU0, which is unreasonable since CPU0 has been isolated. Signed-off-by: wujing Signed-off-by: QiLiang Yuan --- 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 0950cabfc1d0..454021ff70a1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6211,7 +6211,7 @@ static int select_idle_cpu(struct task_struct *p, str= uct sched_domain *sd, int t =20 this_sd =3D rcu_dereference(*this_cpu_ptr(&sd_llc)); if (!this_sd) - return -1; + return housekeeping_any_cpu(HK_FLAG_DOMAIN); =20 /* * Due to large variance we need a large fuzz factor; hackbench in --=20 2.39.5