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 8E37C311960 for ; Fri, 2 Jan 2026 12:48:29 +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=1767358111; cv=none; b=A02g2FnO9KE1HY417tYPZ84c018v0pUBl4X5kmABtkz1Aw8vbTCfAjkBruh0KGVC8jMJOgbHWAEGIde+1msgLdcNGzXDKTRGa0FDAOSQVac7+4n1oiGCAfepOmYIc9wJ0mjqc+rTZ2QW7Zt0KRSkboCe2BLH4lhQlNO9Q7QrgOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767358111; c=relaxed/simple; bh=pCI1AmwHAM1WwLHj5x/5koTuOM0jEhhVgESSGe4dDpQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Gad3+viFw3qR/9I7C29zU9ow0uto37tzCRjl/kWu07XACyHHMnBrZ3VO6wJUViVFkLqCeh55WUsXTjD8Pncg/WoaGTRwluGhnliCYzy5li18SrYvWAg0z60YqGrfGCSY2aD7yzCht2sx8WCXmlHvyx5Ct3ZMNJhBzy692XCGw48= 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=CmLVpM+0; 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="CmLVpM+0" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 601LPOna000349; Fri, 2 Jan 2026 12:47:54 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=8alcc//GAVXJjWYKS2MlhcqpAhTTny17t5x7T9M78 VY=; b=CmLVpM+0SDpfWWRqqMEuDTviQtXYyySMQ8J0vR8ZVlNO6XGA06qLCwr/9 fRcT+Heb4cVeZGLFWkZK2+cCvbjgyJuZbVoE8Mm4xNNXWyGR92XE08X8nS8eBwEF TmNJVSLasIsqusuHFf+io74Fe0Pg30CyUbyXp0onoqOvnC7fAXov1NFmPatAmENr 3toNOBFCMFE4Cr4zHN44fZXzYpeoCuruX4zYQAwaLrPJcCV4mAaTLHByU0gObrKl FmnC2QLLl7IWjwtX/421bGVF/KU4qbMkBVzZCwkt2hqCb57aRY0lDBS6bgAfGads 4UYUsIwHQxLh7dk8dVUoOxWc9a7ag== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4ba73w4f39-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Jan 2026 12:47:54 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 6029GQeK012876; Fri, 2 Jan 2026 12:47:53 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4basst6n8j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Jan 2026 12:47:53 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 602ClpuD23134898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 2 Jan 2026 12:47:51 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 85FED20043; Fri, 2 Jan 2026 12:47:51 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CA29920040; Fri, 2 Jan 2026 12:47:48 +0000 (GMT) Received: from li-7bb28a4c-2dab-11b2-a85c-887b5c60d769.ibm.com.com (unknown [9.124.213.170]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 2 Jan 2026 12:47:48 +0000 (GMT) From: Shrikanth Hegde To: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org Cc: sshegde@linux.ibm.com, linux-kernel@vger.kernel.org, kprateek.nayak@amd.com, juri.lelli@redhat.com, vschneid@redhat.com, tglx@linutronix.de, dietmar.eggemann@arm.com, anna-maria@linutronix.de, frederic@kernel.org, wangyang.guo@intel.com Subject: [PATCH v2 0/3] sched/fair: improve nohz fields for large systems Date: Fri, 2 Jan 2026 18:17:41 +0530 Message-ID: <20260102124744.360872-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-ORIG-GUID: ov5OyHiJz25D_qpjn-XuLWjnWrCVd0rL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTAyMDExMyBTYWx0ZWRfX55WHZ8bpvPzU +9OAn0SFtC9xBeupoPVWbvkTuUsIqNKOn+B3CmOpJ/mPDi5raquybo+RD+nUd6wAKwwkPoinUYQ Zf+awnkEIci7LLjLbI1beXIwV7kpvnsHFICpaTCNq9EZKRCFfS+pxIKILnvqQ3OvRh2XCJd8zWM JIcToLBoV+mml2YI1EtkXfkHnR6vJ7JHvbMxv6z7nl/+ElVZ92CnBCtmoSx5E1NGMXLf0WaDi0/ +5hlsk0DWHBQkkrWtiTcbvd+RzBECkls8MlJLND5D9gemSBfPAJU8oRuauTTO2A1xyzLb+4uFVJ 1XwlVTCDnCut0MQtT92VGGpbVRhLe+D2ou6mcpLtXX4PAvCoXi4dQPnhB8DoYnA7oKK5jEgCFRD WrMe4a0ar1ZtdUm2uGfhNhm/zuqbY+BBMxZUs3s9PZcZr9R6AEqnr3KtG3iTM0aZ12eRwQi731z f5Np60cpTB60xnK38jg== X-Authority-Analysis: v=2.4 cv=fobRpV4f c=1 sm=1 tr=0 ts=6957be7a cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=5QZuRhK4UgV8o0veWM4A:9 X-Proofpoint-GUID: ov5OyHiJz25D_qpjn-XuLWjnWrCVd0rL 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-02_01,2025-12-31_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 phishscore=0 adultscore=0 malwarescore=0 spamscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2512120000 definitions=main-2601020113 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. Gist of the series 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. 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/ Shrikanth Hegde (3): sched/fair: Move checking for nohz cpus after time check sched/fair: Change likelyhood of nohz.nr_cpus and do stats update if its due sched/fair: Remove nohz.nr_cpus and use weight of cpumask instead kernel/sched/fair.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) -- 2.47.3