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 DADB938DD3 for ; Thu, 4 Jun 2026 05:45:46 +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=1780551948; cv=none; b=MEWeDIyhl8CKmQFreG3zabXo8/hvygmxVTKAna6eU/jFAhtTR2a0DGeDgrZ1AHkjzdyY0wppJGuwOEems76L3u3ciFPOiUvlpI+KWQNaNi3MCwCMMRj3vZnmJY+EAWgu6W+wj1qYb7FRRHpdmWxxP6Gq+fQNxvnkxsjeXpBmq7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780551948; c=relaxed/simple; bh=VpO43UmHgFwj8J12GeKFEN/rstOakRH1jODQxsY/Ycg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=smBQlAjCfLuwyBnd62WPjqR4vSQV0yia7F1K9PwMctn+dd36LwFUTJaPLpdfjOF8IWd+IjJEHRaEVegtIsuhe1Os1qa1d6IvUuZUo25+P1ce4Eu070n0pxXQo/Cep7FWT0phr9PiaSFRy9yG12gMhw2kzvAb6sD/9MAIP5UuWnw= 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=D6YoRx2A; 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="D6YoRx2A" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6544aruf3926686; Thu, 4 Jun 2026 05:45:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=jvIjv5 hb+zMRNK6W1FGkkc5BLlurhDBGV4uNaRdlH4E=; b=D6YoRx2Ae4Tftm0q8aSOmd bbk8Rdj9wGwnmC/vR6swXJVEqgqXAJNjuHAvirt5PHEQtB70wtNpcx8bhyfpb8QT FsW7bRJYkCmxJd7j9+pln/e+5kqwW0h/vr4KWIvklaZP9Tyg3ZeXNiyOVeZlsbh5 jTu+U+Mo2jNjx0TAknZ0Bxi2ok7PDQsdEPvy/Ck+V23D69hznnhjWsGymmbdVUJP xW4Vk8u70+bxcHAOro3+aU/BlEP3D8YcU6BxTD3H06K81AGk/3Un4frEczfkT2x4 lo2DoTXvG/OxHmsqQic1iMvEIchmvScYrvlS53Zm0+OxerYVfu8iwcSdi0dsRc8g == 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 4efpaedsuc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Jun 2026 05:45:30 +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 6545dUaC000445; Thu, 4 Jun 2026 05:45:29 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4egceguf2c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Jun 2026 05:45:29 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6545jPjM51446102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Jun 2026 05:45:25 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 574FF2004B; Thu, 4 Jun 2026 05:45:25 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DF6DE20040; Thu, 4 Jun 2026 05:45:18 +0000 (GMT) Received: from [9.124.209.205] (unknown [9.124.209.205]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 4 Jun 2026 05:45:18 +0000 (GMT) Message-ID: <8281bd2a-31a1-4e18-aea2-830777a454a6@linux.ibm.com> Date: Thu, 4 Jun 2026 11:15:17 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 08/20] sched/fair: load balance only among preferred CPUs To: K Prateek Nayak , linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, yury.norov@gmail.com, iii@linux.ibm.com Cc: 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 References: <20260514152204.481115-1-sshegde@linux.ibm.com> <20260514152204.481115-9-sshegde@linux.ibm.com> <0aa0d84c-9d0e-4ca1-9a9c-6370976a0974@amd.com> Content-Language: en-US From: Shrikanth Hegde In-Reply-To: <0aa0d84c-9d0e-4ca1-9a9c-6370976a0974@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=Zt3d7d7G c=1 sm=1 tr=0 ts=6a2110fa cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=K7tpr2rKIWckSKYVC_YA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: v-16clnpQStRHTDw9uzsB8OwkSuQXJJx X-Proofpoint-ORIG-GUID: 8TN_cZjsToUmm9F5FOHQob9m5hd60mIc X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA0MDA1MiBTYWx0ZWRfX3siXFMp+c0Qy 1M1omZCQ78XBrAPBl/yQGnil628lEm7q1XKqP5LvisczY/QGlBhHZy2lkvoAGQVrz1Q7DqJ/7tA ihPoTzPK6WsiqVb8O16QzlkUic+nABiGECzXkDnZudYxF8RcyEde1mGgUIgaQow2vuincvA+EZ3 FY8JM8I6JnPDAkj+Tbq56VHHQ1VdWvk0bGUlYPDQ6xVptp89ER4vnIqpCoLsZ+NPcBtG5cYzYeC M7mcAxB8reUA/h26E3PQSHMOQsbE/x1bHIL8FCWof2fo7IkLr4BGasRaUTpsMvdeeF1rOZAKFER GMPhECpRVkt3z7oi9aSl20vDPjp+/1yXmP9eNXYS78rT1JIfEoEgCFDjktFPPI87BSHbVHCyPvW WL6TvMNM5ZO40adBgoYKJYlJOwIQlQ4KuDKB3G7n2SLnetBalOiK2G3VIPdTHkGSzUVNH0SBT50 ZdfEyeSHmTtIPAiyjXQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-04_02,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 phishscore=0 spamscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606040052 Hi Prateek. Thanks for reviewing the patchset and tags. On 6/4/26 10:50 AM, K Prateek Nayak wrote: > Hello Shrikanth, > > On 5/14/2026 8:51 PM, Shrikanth Hegde wrote: >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index a704285ac55a..0a851d4b0d7e 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -12087,6 +12087,9 @@ static int sched_balance_rq(int this_cpu, struct rq *this_rq, >> >> cpumask_and(cpus, sched_domain_span(sd), cpu_active_mask); >> >> + /* Spread load among preferred CPUs */ >> + cpumask_and(cpus, cpus, cpu_preferred_mask); > > nit. > > Instead of the onine_mask, can we keep the cpu_preferred_mask closer in sync > with the active_mask? I tried to make it active_mask. When there is high steal time, a CPU marked as not-active isn't available for workload which pins them. That would break user affinities. > > That way, if we can ensure that a preferred CPU is always a subset of the > active_mask, we can save on a couple of cpumask_and() operations by just > looking at preferred_mask instead of both the active_mask and the > preferred_mask. > active mask used heavily today. I didn't want to merge the two. > Are there any complications in that approach to track it via > sched_cpu_activate() / sched_cpu_deactivate()? Sorry i didn;t get this part. You mean track preferred mask with it? We end up calling sched domain rebuild too if we go via sched_cpu_activate build_sched_domains+8 partition_sched_domains_locked+1316 partition_sched_domains+80 rebuild_sched_domains_locked+332 cpuset_handle_hotplug+1456 sched_cpu_deactivate+608 cpuhp_invoke_callback+504 cpuhp_thread_fun+324 smpboot_thread_fn+556 > What is active_mask guaranteed to provide today? Are there any ABI for it or we are free to change it?