From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 BD22C303CB6 for ; Mon, 12 Jan 2026 05:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768194336; cv=none; b=MyGyoT7Og1xAnuIfYZSNSd6ICAoZF/vM/C1Ct5+ADfqKnqPFzruE4tvg1AXyWwnvdfahYLs7a8MzRej4KZ9rwzDRLbHQgy9dTAIg5fzE6+2xeKb+3v7iYoDUFHOuaY4FJLsMYG7c32d1LBKvcOqz6O1zSew2SAkPtUcFKPh30kU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768194336; c=relaxed/simple; bh=qWftm9ruK1ZFrKjWNjc3DRkAMwzugJCi1/3OuYDrhKw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MFJFzFTZuGDXFDtUN2z58cSB3QiEKdTGmxW1PMgsHukT16tmeriAcDK1B1Sr+ULFcG0BZYkWnLYjRI2iKc4EhnSlD4wn6imBPcg4loC15eY25DmpAupJH02CCwPn8eaClzHMbrYDEO2uQCp9JbgZhIbGfRnK3NmZjNAe3DkP6y4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=SIAfzOqA; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="SIAfzOqA" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60BJrs3C021059; Mon, 12 Jan 2026 05:05:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=pp1; bh=fSH2ssnsNaqKRLSvJnDK/lEBtG42ZbfJieNO05pyv 1g=; b=SIAfzOqAJd3bTFYz+TBzfZ6IYR3OSTkrptJphe5p/HKajGVxoWhBSl6q6 NZvyh880kEiR9g2KyssHgdKQOb1FIhGZI/McVQrJnONqN84Dq4Xy5gdHP/NIul4k VNK380O9mlZ17VErQCXN0BpzXRfH9xgVpEt0ZfchSxXXHUQ5L6EE+bev+pcpW/WG mtXDghces/qRRc8bhy11IGewaMH/XFtFtzE5vQ4AZL+1ZRQxcqXJJNiz4d+a7d+7 GrNyVNRDSuXcK/woCwc0cnPG7l4sKILTihzs8KFK+d6MopDnhveUCWw795Dozesa j9AdBWNN9d5sz/8G1iTfDV3TzVReA== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bkd6dwd1n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jan 2026 05:05:03 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 60C17c9Y025835; Mon, 12 Jan 2026 05:05:03 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4bm2kk45jx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jan 2026 05:05:02 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60C54xUX50332094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jan 2026 05:04:59 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B480C20040; Mon, 12 Jan 2026 05:04:59 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88E0520043; Mon, 12 Jan 2026 05:04:56 +0000 (GMT) Received: from li-7bb28a4c-2dab-11b2-a85c-887b5c60d769.in.ibm.com (unknown [9.109.215.252]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 12 Jan 2026 05:04:56 +0000 (GMT) From: Shrikanth Hegde To: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Cc: sshegde@linux.ibm.com, kprateek.nayak@amd.com, juri.lelli@redhat.com, vschneid@redhat.com, tglx@kernel.org, dietmar.eggemann@arm.com, anna-maria@linutronix.de, frederic@kernel.org, wangyang.guo@intel.com Subject: [PATCH v4 0/3] sched/fair: Improve nohz fields for large systems Date: Mon, 12 Jan 2026 10:34:39 +0530 Message-ID: <20260112050442.138446-1-sshegde@linux.ibm.com> X-Mailer: git-send-email 2.51.0 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-TM-AS-GCONF: 00 X-Proofpoint-GUID: 84mLkwViyfeH4aXIF92c48c_cmfzKPnI X-Authority-Analysis: v=2.4 cv=LLxrgZW9 c=1 sm=1 tr=0 ts=696480ff cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=RxYRiQ7SSsWcNr38ryEA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTEyMDAzNyBTYWx0ZWRfX4j1hn9tH1mqs Yaheep9+z+vb0hOYDan6g6j/FfdvqsR/4vK7daObuvOYr5JyrxAAgDr4POysvdryVsLNvPlgli7 0+4cXDnkqULdZhB6lYbSH0HqkpkvA04zvxL9IUvp6pdlg6VAmE6+zAefjOElOQA/TULF6NZENzE 4S3zrk50HoYle29gJpWq0AF0I3KX7ccTCAK9EcJDGQik5Og8svIstSQqDa95/d9u4kiMZ5i7FNz kZ48GlXp/vFo9MYNerlZReK9zd2ueiIQGl88KSBw6LIAH6sH0paN+qW0qp+D86WXq3zqWhRDRSq 9JV1SomabEjFVJzdwlRpl5qqSMsgnunuysa3WYY9HqVmQ1XuUV7lG0fUQgIP3fwdkbcVAHmtNOs Ogl89L9978aCIyCg6vyybKl40+0ElFV7Qm1ecbz3SBO6rwp8nr+XPCrtzbcUsxkUo+InDYXYJq+ QB9p7Tlv6LF3eyZPNBA== X-Proofpoint-ORIG-GUID: 84mLkwViyfeH4aXIF92c48c_cmfzKPnI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-12_01,2026-01-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 clxscore=1011 spamscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2512120000 definitions=main-2601120037 Running on large systems nohz.nr_cpus cacheline was seen as contended. There is atomic inc/dec and read happening on many CPUs at a time and it is possible for this line to bounce often. 1st and 2nd patch are minor ones. Looks like correct things to do. Not very important ones. 3rd patch: Main patch which is to get rid of nr_cpus.Instead, use the cpumask which is always updated alongside with it. Functionally it should serve the same purpose. Rest of the fields aren't updated that often. So this line shouldn't bounce that often. Contention issue with nohz.idle_cpus_mask still remains. Mostly it is in separate cacheline than nohz. There are ongoing efforts to mitigate it. It is not addressed by this series. v3 -> v4: - Added to changelog on one less cacheline being dirtied on idle entry/exit (Valentin Schneider) v2 -> v3: - Converted out to return when there are no CPU is in tickless mode since find_ilb_cpu returns anyway (K Prateek Nayak) v1 -> v2: - Dropped patch to check has_blocked based on time. - Detailed changelog for removing nr_cpus (Thanks to Ingo Molnar) v1: https://lore.kernel.org/all/20251201183146.74443-1-sshegde@linux.ibm.com/ v2: https://lore.kernel.org/all/20260102124744.360872-1-sshegde@linux.ibm.com/ v3: https://lore.kernel.org/all/20260107065125.669668-1-sshegde@linux.ibm.com/ Shrikanth Hegde (3): sched/fair: Move checking for nohz cpus after time check sched/fair: Change likelyhood of nohz.nr_cpus sched/fair: Remove nohz.nr_cpus and use weight of cpumask instead kernel/sched/fair.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) -- 2.47.3