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 66AAB3D0914 for ; Wed, 8 Apr 2026 13:49:17 +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=1775656158; cv=none; b=A0ztFE4lunr07OCW9ztCC2+XvEJW0Iaft0iPNdRZvZtoI+39ANPxOblfMgxr6yjFrHQA6QunRkXaWVHLgwfbj595hvkpMHZBK2t63h97yvpdetadoVBRxdiWk1PjaXVX81ArhTiSpAAn9p0nNiWGTDEWwv5fhmp6jEAqdaRkmc8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775656158; c=relaxed/simple; bh=bt6OuB10/U7Sjj2i/2cfqBtRldyYGokFiUY8zk0v5gA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=k0RAoLid9ldFMF38hdjzoT7KrTqEsds4LNnvWH2n9K0/KvrVJxc0tRTtQBhvrS4tV8eGH8t24mEDpUMcgjG0vC6SfkjPHcLRn+82X1oUorPyaoOaFxIXS62JVa+CG/OWxJGdC9joNsC+uw+wgIoox8eSYbBkFfSiGjk+jG7HK4w= 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=XK2iPD7a; 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="XK2iPD7a" 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 6383SMfj2326073; Wed, 8 Apr 2026 13:49:11 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=cBeSfG OLfU6Vfyx18zat4VGwh5N2S7ZPhWJsLQA3I/Y=; b=XK2iPD7ars7YfkYsuvLbbi 86I7OnaT4+Y+HlPPI89nmVtElEfFkgVe7RT7SV8uxnaLkx1Rk2HLJNWj72nBBHFB yb6zUqvDKlaCglU30O4OAs+uS9uxDsRsZEUkBXebbbGOPufCxF6pumjnzpSKGQgO vy+OTKwFO0xnBzcO0ks+9ub7RghKuHOhHcAG03uHS9IpSu/V+TILvTsDTQ7vRats eg/eF9B4aOJqoPtxkSdUOyyXyP6H6PNBeep+/Xiq0fSmo4QvGkdPWu1TdER1knBS XX8wgKNpkiPv1elzBKongXB3PD2mrUTMYMTTYztT9ATuItvndvxN0mRfbS9GuWFQ == Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dcn2kfnu5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Apr 2026 13:49:10 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 638BXJ5M030068; Wed, 8 Apr 2026 13:49:10 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4dcme7fkrc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Apr 2026 13:49:09 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 638Dn8TT29491710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Apr 2026 13:49:08 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01DC820040; Wed, 8 Apr 2026 13:49:08 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A1762004B; Wed, 8 Apr 2026 13:49:06 +0000 (GMT) Received: from [9.124.212.125] (unknown [9.124.212.125]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 8 Apr 2026 13:49:06 +0000 (GMT) Message-ID: Date: Wed, 8 Apr 2026 19:19:05 +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 v2 00/17] sched/paravirt: Introduce cpu_preferred_mask and steal-driven vCPU backoff To: Hillf Danton Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, Sean Christopherson , vincent.guittot@linaro.org, yury.norov@gmail.com, kprateek.nayak@amd.com References: <20260408101406.1617-1-hdanton@sina.com> Content-Language: en-US From: Shrikanth Hegde In-Reply-To: <20260408101406.1617-1-hdanton@sina.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-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDA4MDEyOCBTYWx0ZWRfX/hs0uo+1GFnU UUp2hYOFCFXPPHZY0fZiO6ZdvKArqQFo35O2gDITCp2xW2oLgfgr6zggbxcEPBmKkwQLVerViv3 sC22RkduFDDqAiu1oFzYKrcpIbWMgrle5TcqgIYm2SWWTreandmqu0pjDYszcu2zHFiMz1kEkRf IF/o4goMnStOdsUipTBDDpX53+eVGJqwwPsxez7llr2qfQKpeVaIuXnrAnNW9iMxPxaD8UiPnZs feCUhAe2o/ePjafJWo0MPMhV4yf1mIOaexLVWs2KHvWplFXFoXHKirFtuCz1Zsrb4orNaXzcOKa /SZfHmF3KSu/Ez4hkVLOEcW8HpTHW5VuJv6JtpJe/tqC9Qun40XccEA6gPBGzPzNSCJclWx80hD 1O+MNfHXncuSN+GkVNQvn1kWZQLPlPcw7XAJ1DM1N6AChJJ5sA2Zn6IPnQJYiNaf092z/L66c7z 4wWmoLo72TT6ao9tp8w== X-Proofpoint-ORIG-GUID: RuxTbpHipC_kfG9_ehptBVgO3-um_QOt X-Authority-Analysis: v=2.4 cv=e9k2j6p/ c=1 sm=1 tr=0 ts=69d65cd6 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=YE-TAVDAsBnLdR9ojUsA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: NiJcZQh71RhhdvVAdYzrw_2cpvaXB506 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-04-08_04,2026-04-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604080128 Hi Hillf. On 4/8/26 3:44 PM, Hillf Danton wrote: > On Wed, 8 Apr 2026 00:49:33 +0530 Shrikanth Hegde wrote: >> Core idea is: >> - Maintain set of CPUs which can be used by workload. It is denoted as >> cpu_preferred_mask >> - Periodically compute the steal time. If steal time is high/low based >> on the thresholds, either reduce/increase the preferred CPUs. >> - If a CPU is marked as non-preferred, push the task running on it if >> possible. >> - Use this CPU state in wakeup and load balance to ensure tasks run >> within preferred CPUs. >> >> For the host kernel, there is no steal time, so no changes to its preferred >> CPUs. So series would affect only the guest kernels. >> > Changes are added to guest in order to detect if pCPU is overloaded, and if > that is true (I mean it is layer violation), why not ask the pCPU governor, > hypervisor, to monitor the loads on pCPU and migrate vCPUs forth and back > if necessary. > AFAIK, there in no information in the host scheduler on what each vCPU is running. It maybe holding a mutex, spinlock with irq disabled or maybe in interrupt context. Moving/migrating the vCPUs threads without that knowledge will hurt the guest. And it has to ensure fairness. This has to work across different archs, some have linux as hypervisor, some has non-linux hypervisor such as powerpc, s390. Steal time in guest is common construct in all archs. I don't think such commonality exists in host schedulers. If done in guest, guest actually knows what it is running and whats more important. It can make better decisions IMHO.