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 A8BC23ACF06 for ; Thu, 18 Jun 2026 06:45:50 +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=1781765152; cv=none; b=o8/a3xbCKVVbOEuE3YjECRTfqBT/zSiU62yPFNfM0Im4S/5ZlO5WaG+fYIgdJq5YhSBqCMt3oUB9+5dHhZm0xXdDvrwZX5B79GcsB2SL5Ta+jskFZ/cqKSXujawXliUOCz+kFoeqEOu7l7ql1ET9bFNt6vIIfYbXsBvVpkaSS8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781765152; c=relaxed/simple; bh=XsTz4utmMx8kpnXcGa1npNyvlBrLUph25GryP8CsLnk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RE5JuMnMDyr+foPygooSIK5ooArDJE6epSwQGn8gmmmDmedg9lBd/3Z0BLLwSn96Evfk3QTNhBa6fZWGLPTj/knxRgUDaCt3JDOv3qONXkauIVUfzilEPNiqqGMvUozYbe4jOEWWAeUwSEqfdNAVrIHrgXbWmqIw/r0qFI4Zjr0= 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=V8yz4e11; 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="V8yz4e11" 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 65HHmZ89977989; Thu, 18 Jun 2026 06:45:29 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=HgVEgT bmYbC2ClyXYJFzwqbfW/8JaZ34CzbhkwruZt4=; b=V8yz4e11u8mzxaezQ9nTrY ICrnxWCtuVQKmD+vjfr0DP2sHcDuBVehyUfXmNUWPMXqgql4UdePW00ZYlLtpywM t0yYr5QNucGXFjHUzs6/0Oe5uyayqPIUdpIsaeKHZujKULKycpMW6IraxZp9eYqE ZODV9ZOJcK+E4hwwthm5DR/hZbyu98YCFtq6sXpYhkADttTerqcUg40cDzHZhVf7 k4CufplW4cOgps9Jj5iBMGmoaOHvqbNF/1TFG3wcVOzsOcaNzEDdt9D1kQdtABLj fmjDkiDz59PjuClkLXm/8gAUf2UETWysVWhqpSPTQ9MUGNJhNNBv7L+dHUK7pi3g == Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4eueqx6mvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jun 2026 06:45:28 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 65I6Yc0g030696; Thu, 18 Jun 2026 06:45:27 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4ev172ad29-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jun 2026 06:45:27 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 65I6jNDO28246680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Jun 2026 06:45:24 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E10972004B; Thu, 18 Jun 2026 06:45:23 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D68AA20040; Thu, 18 Jun 2026 06:45:17 +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:45:17 +0000 (GMT) Message-ID: Date: Thu, 18 Jun 2026 12:15:16 +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: Yury Norov Cc: K Prateek Nayak , 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> <0319e8ae-3e7d-4ee1-93e3-424eb155aa7e@linux.ibm.com> Content-Language: en-US From: Shrikanth Hegde 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: UOM5SDSeseTIHTX4QMzlYN8Wqp3khIIc X-Authority-Analysis: v=2.4 cv=Le0MLDfi c=1 sm=1 tr=0 ts=6a339409 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=1pheDkqbWo23VLfQYGYA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE4MDA1NSBTYWx0ZWRfX3zUeozd3aPrj PbZenE2fqJBUijH0Iq/j5KlTdEd+FWIc+MLRloMEZLZS8oBeuR8XFukErOZxNfPiE3Aets0+XYM kNhDjyctEe4WBvxrDHohPMziPQaM+Is= X-Proofpoint-ORIG-GUID: SeJnijhXwSd8bFqsXIpii-LUx58jwcD5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE4MDA1NSBTYWx0ZWRfX3jv0KI8ol+s+ TijgWADXM0VZBba/y5W9zFEnDBLgkcyhXC6ShW2lufBAcePOIn8H9pDVD1sIK4lG3UAB6OR7C+U +quJlLQdX/2pjeLcX38mFOgjNvKu8xerolKA5vGSfAxQ9/IVZF17CeixfZtubr6ElG/5RJbTMON R6lMEjp8hyOdukA91HGVDvErKPssKbElIrunm7nGSox+mDDg5Yault2tABu9+nZpIjWDh9+cbPD 1X0YDr8SyMTi7ueo5cQNERBc07cY+GU1aUhWv7Wk57xiNwAQjWPsvgNUYdY2gK2yLV4E4XiqgRQ 47opV0RH/91DDR82cTmUMxbyIO/FUbLC1tn4XYh3zO5YwPLU39TiTklORGvoS3YXzp3TAuWDu6P e/hWFe04jf5MMNNwhij7asHpbYu2eABqYXHoARcXWxYtdtRD6BLp/00TLYBiUjzdLy1Fx8eNEBN fKrey1JKEDm+PtG4t9g== 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-2606180055 Hi Yury. On 6/18/26 12:09 PM, Yury Norov wrote: > On Thu, Jun 18, 2026 at 11:31:17AM +0530, Shrikanth Hegde wrote: >> >> >> 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? > > The enable/disable part will be replaced with insmod/rmmod. The > statistics part - IDK. It is nice to have all stats at the same > place. On the other hand, without the driver loaded it would > always read zeroes. It anyways is just a single line in sched/core.c, > not a big deal. > I was asking about these debugfs knobs. steal_monitor/high_threshold:500 steal_monitor/low_threshold:200 steal_monitor/sampling_period:1000