From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 30C2B325709 for ; Thu, 15 Jan 2026 07:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768462584; cv=none; b=TlmALV9bTI9Bf96VcctVZMU/cv5uo+nZ1HsLorXb7m2Ymd9oWABoI1L1UtlCEGQTEt+w9VOTsJDD2dAARel6eHCt6+uK+D1yvB/kdThdTljCDzp19Qw5VOr5YWXiRQwCeotdGDgD6S2Vp71Qa8KJC3EuMyuN175vwnSzZbUJLV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768462584; c=relaxed/simple; bh=3PvPwmlmNVGi+zXQN+jAfW9GpyHmFrbcCNk0yfGLYpQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tiq962wHvk67A0SJIEqZnLSfk25+zOQ7XY29EJE9HtJIgGpC/P3T7QwsQ8AxHqFvd98ll+yXOI72eTGWTSDWEMpsPeYnVJzJS813QvTNpfz2NVMmO3npkNjITiTIy9DbGnQ2864bhJ/heT9L8+cojujNCR2o5z3jKwdB82NWidc= 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=b7qaUa7d; arc=none smtp.client-ip=148.163.156.1 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="b7qaUa7d" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60F5bbCm012095; Thu, 15 Jan 2026 07:35:41 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=rCnQI2evXdJ+2PKpxp8ebhFRmHcaf1XMI1+H8JNzT Gk=; b=b7qaUa7dVRgfDYw800vNcJ4ZpTNB97EjaEpxGS5I4E88ut1hGiTZEOgXi h1u0s7t21mqjMtFCZNIEWA5nZ4NER3LIzUFUoc91ntMiFE9qVr1Gi8LHLX53Kb3z ivpVh8BzgSPo1kuvHyOcXlfNPViqlsvJQj7YOOV17NX3feiyouIt9DGsMVfHnUim QPutgFdZQYuH8BpxxIcSRokgOm0nEJrkAgBOc7fNGmi34q3Zf2rCS6lMTKbpfipK t/ixkb8EqJaoTC1jUKr+ZG1FKTgYId06q6OU4UYfxALIEWjnvRxKVAgFEkXFAFqi buJsqPbj3J1LOObl+aQnXm+e9gy4w== 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 4bkeeq5cbd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jan 2026 07:35:41 +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 60F72Tii002510; Thu, 15 Jan 2026 07:35:40 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4bm13sxvwu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jan 2026 07:35:40 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60F7ZaRL51905012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Jan 2026 07:35:36 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7A28E2004B; Thu, 15 Jan 2026 07:35:36 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A659820040; Thu, 15 Jan 2026 07:35:33 +0000 (GMT) Received: from li-7bb28a4c-2dab-11b2-a85c-887b5c60d769.ibm.com.com (unknown [9.39.17.239]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 15 Jan 2026 07:35:33 +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 v5 0/3] sched/fair: Improve nohz fields for large systems Date: Thu, 15 Jan 2026 13:05:21 +0530 Message-ID: <20260115073524.376643-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-Authority-Analysis: v=2.4 cv=DI6CIiNb c=1 sm=1 tr=0 ts=696898cd cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=RxYRiQ7SSsWcNr38ryEA:9 X-Proofpoint-GUID: KrBecDoiEwQebdPpDRMETJoMnOlJhcEF X-Proofpoint-ORIG-GUID: KrBecDoiEwQebdPpDRMETJoMnOlJhcEF X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE1MDA0NyBTYWx0ZWRfX12MZ6nDuxno1 pHYAphvoUoRwa+/JeN0Vw8TLbPf+jiSVxwdouCyY2i+pSt9PgXgOJBIiRkVp7mRMkF6YTzjqaYO MrJyNClfCCNCyoqiuR0aT83YO3iIxhM7J+HDUctYKi8b45QcxA41Fl9JZJmC8Uy+7ZMpxqhW3r/ yIi1g0HKXdM/oAtJmOyAAKBpjJvr3ML4H7qGzH3YILj+h3wULGfRSj8cxs0CWCBy8k9CLJa7Zsl eEU8XMnFsfzKS265GeHtBNUZRbinBO3+Bp6rg1ifpwCmqBxMnoQUMq0r6reEYFjMUDZXwiSGypw yMSPOpWkrPL2VVq+7gRofS4nz7cVVjmE34DghQg4w0eImuqyaUeXoUkbmfD9Ft0IhK4679O6wlb /PD071zjxp5d+RuP9R3bG0E1Qy43Vstnq1iTj2VH5PL9c87NSbRGhWq3vhIyx6PthuOc1PpFc+7 Ueg0BgZyltkhealcsXw== 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-15_02,2026-01-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 phishscore=0 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2512120000 definitions=main-2601150047 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. v4 -> v5: - Collected tags (Thanks to K Prateek Nayak, Valentin Schneider) - Added comment for patch 1, making note of a narrow window where kick_ilb will be called un-necessarily. (Vincent Guittot) 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/ v4: https://lore.kernel.org/all/20260112050442.138446-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 | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) -- 2.51.0