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 8E41B410D23 for ; Thu, 14 May 2026 15:23:55 +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=1778772236; cv=none; b=i8SoEkrRWuABtzls3AkgbTrYGBnPajvEZOO1L0EUNLgEdY1V1/2oSRaKT/EbYzDDxSxaC6wkGfz31PJQ1g6lauwdYRT0Rghkme8mS9cDKrNmYLSuNeF3/0FcFhmPbcwkXbP1Y/mfWkwGzIIMPoxWJcYuY6omOT5KIFtS7WpxekI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778772236; c=relaxed/simple; bh=8p7g/vtVZJfouoOglo4oDpL5QrW5K7qN3B5mDMobHAU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wt1cDt5f582+m/RnBujrzNjaVmJyPC0fYSSA394sGrdpzKQenE5bu3oNLMhvP158tOGz5QyOA8TjKOBrbzc+fF/nv92ooaSaKM0ZIruyA7nar5LGs3kYIS6K+1d4P1/3HPGC9QfoasAcyj8wzUe1E2Ni5b+oO68hmI06RDFxbnw= 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=Kv52A/7m; 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="Kv52A/7m" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64E7ClvP3179988; Thu, 14 May 2026 15:23:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=EYlELJeYcYRelgXoh T/7x2GeicCmP9VbQ96uFudAuTc=; b=Kv52A/7m9gxRpVToJT0R/HQtaOUMJ7WAa MOewJJLBn2Gz49gAXl+nTKED3JV+PdHyyV8HdCRRr4TJ5WNH/7MbtLmJp3lFdxwQ GzXOQ/AMSjfAsgJhYFzEjubNsD79WrbIecqzdUI/NmQeAPUpvi0XJsChO8DDaOsz SY37KXqDWHr4uw42OIuaUQFhinid7k5VsEPH7NJs1fVHxolXYWlT9MqQ0+E+dIYE QcdgIiB6yaWlqHLhoope7oVyzPpXGXpiCG/D9cc1cOzt2CmpDIIdwQ3AFrVRo7pP ih42dEty2kWhW5nTpS0b3idzYiIE+TWGHXssWEA+KtWg2md9t5rdQ== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4e3nv6vgsw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2026 15:23:34 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64EF9TSr012590; Thu, 14 May 2026 15:23:33 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4e3nfgvxfw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2026 15:23:33 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64EFNUb941877808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2026 15:23:30 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 183ED20043; Thu, 14 May 2026 15:23:30 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9978020040; Thu, 14 May 2026 15:23:22 +0000 (GMT) Received: from li-7bb28a4c-2dab-11b2-a85c-887b5c60d769.ibm.com.com (unknown [9.124.213.185]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 14 May 2026 15:23:22 +0000 (GMT) From: Shrikanth Hegde To: linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, yury.norov@gmail.com, kprateek.nayak@amd.com, iii@linux.ibm.com Cc: sshegde@linux.ibm.com, tglx@kernel.org, gregkh@linuxfoundation.org, pbonzini@redhat.com, seanjc@google.com, vschneid@redhat.com, huschle@linux.ibm.com, rostedt@goodmis.org, dietmar.eggemann@arm.com, mgorman@suse.de, bsegall@google.com, maddy@linux.ibm.com, srikar@linux.ibm.com, hdanton@sina.com, chleroy@kernel.org, vineeth@bitbyteword.org, frederic@kernel.org, arighi@nvidia.com, pauld@redhat.com, christian.loehle@arm.com, tj@kernel.org, tommaso.cucinotta@gmail.com, maz@kernel.org, rafael@kernel.org Subject: [PATCH v3 03/20] kconfig: Provide PREFERRED_CPU option Date: Thu, 14 May 2026 20:51:47 +0530 Message-ID: <20260514152204.481115-4-sshegde@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260514152204.481115-1-sshegde@linux.ibm.com> References: <20260514152204.481115-1-sshegde@linux.ibm.com> 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-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=Us1T8ewB c=1 sm=1 tr=0 ts=6a05e8f7 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=NEAV23lmAAAA:8 a=VnNF1IyMAAAA:8 a=CgApyjHX8VSDXvJVescA:9 X-Proofpoint-GUID: 9HII3Ub_euRVgk4aURQ8-MptGmczvzD1 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE0MDE1MyBTYWx0ZWRfX2hfzTg06RwKe 5T58twTlXVgbPe976LIPw38CefYXkT/cPddCuXvDOgqku2JIeSeVt1BwRn/XtyFbXL6sBy3WE1Q A0aqB3JTrdUR71OrnniHFgdcy19KG73O0jmOSiqvUTUAIKT0sw6RdsP1rQAf/IklNIqY/CVwDtY /sRuiFLgFU+4G/AFgXL9f/4Lbk5To8PDVW5JzNreRCPYK1CHmKKutTKMpEOkSAvzFQM/kRvX80z JobGfHMPnMRtCjuO78PQEM1N8imQNjpXj5VJFc73xDn4v4uZL6gJFLVf6yyJarEpZ/vcE9SrXEt XFrKNpalqBzPAC4UZdqkV8iph9uM60ZeuViUz51bSmxulvETYuWMljgClaDPSt8pYu7sE9PVp0L RsZcQ6GOTsI/snBVzTbSCx4N5DE9i4HjQHkTi9YXHq+OiyVZsr7xRqdpSX918R0DqOWeF/c1Zj3 LHTlaT3iSBBbS4VmYcg== X-Proofpoint-ORIG-GUID: o0HIW19zM4T2YnCMpvYyvdVuPJXa2g3u X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-14_03,2026-05-13_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 spamscore=0 malwarescore=0 clxscore=1015 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605050000 definitions=main-2605140153 Introduce a new config named PREFERRED_CPU. This helps to: - Avoid the code bloat when PREFERRED_CPU=n. In that cases preferred is same as online. - Avoid the ifdeffery around PREFERRED_CPU in many files. Since par-avirtual use case is the main driving force of this feature, make it default for kernels with PARAVIRT=y Signed-off-by: Shrikanth Hegde --- kernel/Kconfig.preempt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt index 88c594c6d7fc..495252fef768 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -192,3 +192,16 @@ config SCHED_CLASS_EXT For more information: Documentation/scheduler/sched-ext.rst https://github.com/sched-ext/scx + +config PREFERRED_CPU + bool "Dynamic vCPU management based on steal time" + default y if PARAVIRT && SMP + help + This feature helps to reduce the steal time in paravirtualised + environment, there by reducing vCPU preemption. Reducing vCPU + preemption provides improved lock holder preemption and reduces + cost of vCPU preemption in the host. + + By default preferred CPUs will be same as online CPUs. Depending + on the steal time when steal monitor is enabled, preferred CPUs + could become subset of online CPUs. -- 2.47.3