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 7E1898F49 for ; Fri, 19 Jun 2026 06:27:31 +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=1781850452; cv=none; b=jMoSRSy/RX7tmJTU28za4Z8qaGN238Yx7aHgN7wyBCWOBciJpBPzrUibbMG8VeeTnM5hnBTXcUPRFc/4EO4Vv9fjLjsNvXSqKfvjQaky6Ek+ql573DYZGylb8ooGyeuXsQk7WhsnSBa8dE9HXM12Jxs7ydaVECFr3nIM0VOXd18= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781850452; c=relaxed/simple; bh=Jn9+VJdgP4nqzikoGC/YNwTqjlrA0eoDssJ5A6AnOIA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WtK+u4kZzv0pWUipl0rJ7zB7Chwnl4OlQbwSgt5V4XxhQnMmbO+25vFqrGlnxuwgmvcovJfTYUWrePxPNmaN3nM4pH5tsnNy57IRmkActnZpAO00zhLEkI8Wp9fR90fEvCUUdeO0puwMHcXo2+MYxNxyUCsu2kSBbUvqTE39h10= 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=WFlsPVWX; 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="WFlsPVWX" 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 65J3IbBP1028112; Fri, 19 Jun 2026 06:27:09 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=WtLJ5i Se+KGQDZE4KzsHiI1Y7VLMHycTxUSZxu6p5Lo=; b=WFlsPVWX44qA+5ormSSS9l 0P6OEq05GCIIb0MLIz5ChNLusGxfU/1y9hoNKhsCojC5nRFyz8CaOca90CAmI/dQ q4T3lncsKZuSDTWphsmz4szk2xewIt2E0VeVX4T2t4N3SqYiXt6rp+QPuSTQ4lsz Iw226vYYJEBsGzak9h7X/xh+SlKbnvU2BWWiuul1qU7yqYIeukuxBTORcEt4sWrA QYhfV+1n677LUH+Oa/YZHMRgp/UN6cYv/uS6Z60VSCPH65f2AFyiG9gNxeefS8Az zFV/AZsbUSoK2yTHOBWGUMFz8Vn5KewhTfuPy3hgvVhhW+qh5yuetb2Ok/lPPBkw == Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4eueqxbvjw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Jun 2026 06:27:08 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 65J6JnM5001010; Fri, 19 Jun 2026 06:27:08 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4ev172ffth-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Jun 2026 06:27:08 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 65J6R4vN59900360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Jun 2026 06:27:04 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3570520043; Fri, 19 Jun 2026 06:27:04 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2230020040; Fri, 19 Jun 2026 06:26:57 +0000 (GMT) Received: from [9.39.16.125] (unknown [9.39.16.125]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 19 Jun 2026 06:26:56 +0000 (GMT) Message-ID: <30e28bde-52e1-43bf-80d5-69cf2a21bc8f@linux.ibm.com> Date: Fri, 19 Jun 2026 11:56:56 +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 , K Prateek Nayak 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> <0319e8ae-3e7d-4ee1-93e3-424eb155aa7e@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: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-GUID: v9oYoQFuzE2EdlCZFFxBAgJ8HlfCTGF0 X-Authority-Analysis: v=2.4 cv=Le0MLDfi c=1 sm=1 tr=0 ts=6a34e13d cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=c92rfblmAAAA:8 a=VnNF1IyMAAAA:8 a=pmY0Sb7iBnHgltVVockA:9 a=QEXdDO2ut3YA:10 a=GvGzcOZaWPEFPQC_NcjD:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE5MDA1NiBTYWx0ZWRfXw1iuZ3kHn5/Z KK4aW0junELxjPaxvdZz1ZWYDKSRv2m+i/jPRLIMOJhqzqQmp5uGBTldt0xv+is0eWRYb68iq/V uZ/DBpErEb6ygBnpvK3aX3WPS8j0KpY= X-Proofpoint-ORIG-GUID: PyHbonbxbj5KnzLHyb8MUB6lZRajDalq X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE5MDA1NiBTYWx0ZWRfX7YRwywA6kJLC ch6cAneZsCbabxB3kYqypZpvH9eEY/s6/V+jsNbvn1qGidlSE5obI+nK7G3xEMiZnVC+UQYQ91L ZrOdZ6seNljvQWRs+MkqwloIY7uOU3N8TWRUXcVctDu7nOebRnl3qUaacReOg4wsB1k/yE9voCJ u1t8hC3E/5C5Wxp4PlP/LdIyEZ+DKxDhSYPlmKduLpnazsIyKvmKAobmYMTCLR+hl00+3vn0fUa 84E7AU0HO/eciRNSrP7oS2lPERDzCaa30Dl4kjjun+/alEtah/HZLuIJRyMxPXCV0c9DW0pkvSB 6w1S91AzQLm0JImOsamnv5y/jC0Ex10CXkmoSOs0qfdddv1AT5GuLYOhf/x2fJt3dqK3BnDE8ur MlEKNr7YqTWDd6eM09k5WRTlBV49PbmAJsx5rXpIWNUWI/1YP+UNsRzHwk+Kf+J70V7Akc1pTg+ 9aT/oJT624cyVh0b2Ow== 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-19_01,2026-06-18_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-2606190056 [...] >>>>>>> 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 > > Those are the driver defaults. And if you want to override one, then: > > insmod steal_monitor.ko high_threshold=400 ok. I will try moving steal monitor into a driver. - create a new one in drivers/virt named as steal_monitor - enable/disable will be insmod/rmmod - debug knobs will be module parameters. - there will be default hooks, any arch needs specific handling it needs to do by adding its specific file. (somewhat close to cpuidle) PS: Sashiko too had some interesting comments for the series. I have fixed a few. https://sashiko.dev/#/patchset/20260617174139.155540-1-sshegde%40linux.ibm.com