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 44DBF42A82 for ; Thu, 18 Jun 2026 06:03:14 +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=1781762596; cv=none; b=miZQc8zQF0+9gUEVtbm6/bXnG0Nggt4jkUZHULDrOFHH+3EhOQkc1pJDJoZ6zMjaQrXP/dsc+EDYm7BtddBeoIpoOcg5dQMo9RLyFIewkfdT2uZJqsd/oToLy3azQVuYXpXVsEwBjUCMVhhHKUcYr+q4DVl9jMEIZpx1h7GytOo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781762596; c=relaxed/simple; bh=uhJHUiWt3xOtHwUfScEAKQKkTEhdobNDJAsjN6+g37s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mZy8DdVVskRDInQnTfE4zkWAc5LtNY5OIZXLkjYFvIITGMgcyv5GuQE8Xa3YDBVx/6Ig7zb4/I6h9LdRszvrIJugxd6W+UcC/UYrSnkuZPgyceksG1CCYoKPS1/RMSgM6r02JF7vQItayAHi/IJaWqdFjMZfRuRGF7OUAl0tfg4= 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=ZE8n7C10; 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="ZE8n7C10" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65HHmaEL978006; Thu, 18 Jun 2026 06:01: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=8P18RJ LeevOaNCy9kM1R+nS4LAnSu8KeCJD336HkRao=; b=ZE8n7C10wcoInwnbAUnFu5 dCUCRgbN7FqU1OrbHnUMnNgDD1K15aobTN3VZmlG1r8kO0WOaCSxoPSK06heAfSy 1PVD+vi5LfgSB4U7Ccp33Kt9gBn5namItbZ0c4Dtd977B7xEgfSIjtZ891z6i60x 8KKX6guNhi+sUMV69HQnVYvDFPqyUeYofYeIcLGkGANQDMP7DgCYkyak14rBzk5Y 6f+9mr23ul2xMRksuF5BXI6/N/VHS//btaOoCy0fuowtNJXtwKo9nGAVpvD4rk5l OLRm6WbiFOX7M58wtTfpkDieAJb4uJbcxbrq2kIm5seCyHV3bxhFFbnY9Lt//mtw == 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 4eueqx6g2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jun 2026 06:01:29 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 65I5nh7X013836; Thu, 18 Jun 2026 06:01:29 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4ev172a8u9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jun 2026 06:01: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 65I61Pa926804720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Jun 2026 06:01:25 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 303592004E; Thu, 18 Jun 2026 06:01:25 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C21BE20043; Thu, 18 Jun 2026 06:01:18 +0000 (GMT) Received: from [9.123.5.233] (unknown [9.123.5.233]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 18 Jun 2026 06:01:18 +0000 (GMT) Message-ID: <0319e8ae-3e7d-4ee1-93e3-424eb155aa7e@linux.ibm.com> Date: Thu, 18 Jun 2026 11:31: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 v4 14/20] sched/core: Introduce a simple steal monitor To: K Prateek Nayak , Yury Norov Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, iii@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 References: <20260617174139.155540-1-sshegde@linux.ibm.com> <20260617174139.155540-15-sshegde@linux.ibm.com> <834b0300-2e5f-41dd-9b2d-2056256c1fdd@linux.ibm.com> From: Shrikanth Hegde Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-GUID: 9g1KwtWYz9R8Pi0RFijrNVPFG0L35gTT X-Authority-Analysis: v=2.4 cv=Le0MLDfi c=1 sm=1 tr=0 ts=6a3389ba cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=f0LeDfSuZ1Qk_AGNXWIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE4MDA1MSBTYWx0ZWRfX1lUSZcs78WXO RKXaEiqpiqQNO6PpvRixGBGRguwQf+jJnIDNatetHS8CQ/RAaUARMkeF8qu3xG0toQNle+Y3C4D Erd0yYDDlBmsHtS8OVvDVHdaVlZ7m3g= X-Proofpoint-ORIG-GUID: 96_5snDuTdtbnZE1sMsTehTwr-tZUM7Z X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE4MDA1MSBTYWx0ZWRfXxgRIwQfN9fBE ENVmTkXvBciVCc6i4OqIetuRza8/SdRwecjIhA6xM46v3EwYVdrCRwJdJYLzJflGGeLH7/J+2IC s+t4kf2hz9/kM29VaVulbzPB4229LeBmZ0ylNmYIr9Euk/3H66GJtWP98rI2xvvLyRpJPvJLD3K nJixGLdXt2JdSZmZKWS//g635opJE2WxuueBP8BGkvmusQ7OgMtoLIZhIvY/8GCaofJ/HdQ1ZY2 BoW7zx3/m8vgOy3jX/pjqpgglEpe7H4ZxB2ZKK42c0D0d2/VBE8LWJuGh+m42CkpIYp3fWr9bmD HMQ16hrIKLqLMNgPk/dYDbdVwXY5bJuhmdqddkdc1nQczp1zr7O+tLsSgC1VaBHNSBTesrgTAH5 6PNAY5kA9jk4O87Hh5RP8ibAST6S6SwGKPI3/z3Z12Cizm6TfGVNaHEII8l1FuFVOcKs5GTEpHY ox/QZfUpnoOyR70XlgQ== 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-17_02,2026-06-17_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 malwarescore=0 spamscore=0 suspectscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606180051 On 6/18/26 11:02 AM, K Prateek Nayak wrote: > Hello Shrikanth, Yury, > > On 6/18/2026 10:14 AM, Shrikanth Hegde wrote: >> On 6/18/26 10:00 AM, Yury Norov wrote: >>> On Wed, Jun 17, 2026 at 11:11:33PM +0530, Shrikanth Hegde wrote: >>>> Start with a simple steal monitor. >>>> >>>> It is meant to look at steal time and make the decision to >>>> reduce/increase the preferred CPUs. >>>> >>>> It has >>>> - work function to execute the steal time calculations and decision >>>>    making periodically. >>>> - low and high thresholds for steal time. >>>> - sampling period to control the frequency of steal time calculations. >>>> - cache the previous decision to avoid oscillations >>> >>> This monitor is the one implementation out of quite many possible, >>> right? I don't think it should live in the core scheduler files, it >>> should be a module. > > I agree that this tight of an integration with the sched bits might not > not be required. > >> >> You mean similar to drivers/cpuidle/? a new one drivers/steal_monitor/ ? > > Since steal time is a virtualization concept, somewhere in drivers/virt/ > probably makes more sense unless we need some scheduler internal API to > implement it which shouldn't be the case. > > All the driver has to do is track steal-time (which should be available > via kcpustat_cpu_fetch()) periodically (using a workqueue?) and should > do set_cpu_preferred() (which needs to be made available for other use > cases anyways) so it should be possible. Yes. Seems like doable. Do you think it would make sense to keep the debugfs in sched still? > > Since you mentioned you get an interrupt in LPAR before vCPU is > scheduled out due to contention, perhaps this also allows for a way to > add governors, and other heuristic along the line. > No. when vCPU gets scheduled out, there is no such interrupt. Guest vCPU doesn't know.