From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from BL0PR03CU003.outbound.protection.outlook.com (mail-eastusazon11012060.outbound.protection.outlook.com [52.101.53.60]) (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 035A314A4F0 for ; Thu, 18 Jun 2026 05:32:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.53.60 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781760775; cv=fail; b=b1C2bzyJUOQPAHCrWyhBWNQGAxnYxXrE2N4WBhevf9dT5dcDINRC63hzlSBR82jx6NSWfUvilRt0CsyNop32uD1mM0I4eEa0zmQ3ci25kYeaE1q5JuKlGenRzp7v5JS8dgx5LQGMoxP4YMCbTmp0wRbB2RT6aLGa4TYFM08HVXE= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781760775; c=relaxed/simple; bh=AvnunksBIzweRIJFegSytBQxuEIONxEWh8a/SVtwo00=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=ESPPQcGSdoZAtIPaT7OurVQneGyr4D7pR0QHO7xoVVMiENpYnewKCSKa+b91USbcnuoUatWJVZTfiXH5K5oZCWPFXuPxusXTz7l4XeYDa3r5GSNZ1daREuxW4yp1xML/5ZJYbSAZ0bp5X20w7k0wd9dP2sTr1bIxUtPF3rdmAEM= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ObC2GWhm; arc=fail smtp.client-ip=52.101.53.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ObC2GWhm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UO3WAaZvm30j4ON5lwxKO32pcYUpRYyBjWM8IVvkbXVDjj49CR5pW/zsdaE40YRPGYJKBYO+kJUAW05Cfzq7CxLTqpR1DuynYPzPp4ntQAPvaUo0iwKK8GT078YOHtWVDk4BAuniHxFjvS8zbWWDLlVIFSPDH3m0FTqjyCRPpWPqXydEltxZQ9UMYXQRRYTLwKZBhAMSe2x+AfjHJ5zzbcoCOlLbS8ro5RALjaTkrWRmcYusD9ypFkTOofjs4wTpWMH2izg29yxBqGfxegg82LxqR70nvUnv7i3HF867OLUU5fB3IAabd9HKN4vaW/QxAIU7CMnH4xTts1m1pVkblA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0R28oJEVymu22DDAT6SFTuHdkydNdM72pzeEPJyC/nY=; b=GfgJ8Rj3GoczNfwFoNMvEd7i6kfvORgaCGROOy5Dtw8KGepXpURUo0QWiUsWiUi6Y3QEfdffILspT5xwwSGnTTflx1fwffl3aKjOt0QUC5YUcpqsc9uY7uuJHUgW6c4Pe5GDgRzfx4GMWf6lqHApsd2sr84ol/ko+vRh61MfHd9NHgemG9EPaWwzo2AQPHTTFiNPsEznRKbBWKT7A1GUDT7/c9Xdy46HnKdegLq87t1+SibCKmYU3IPW+nsZRaLRjrdTy7mwsY43mfn7i2+1YAGFo6Cl2To1L7Rbb81nDcMm2MuEDqKBRISvqYTHKScnU+OpbXi/phQsofzCqMjp1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.ibm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0R28oJEVymu22DDAT6SFTuHdkydNdM72pzeEPJyC/nY=; b=ObC2GWhm1GZeXg0gtmnvQmaxe1fIDK9aYvGg10xcY/f+xIwLqr3FXGb7OG15h8WdeSBK+haWbhOYMEwZ/RRg07nS2qkoiwzopN6bzASWNrfcJTcxn31AYjN7ubc4FG7dkB8Y/4zmjsV1vU+jQZo4gxKvr9oHBpSMX37eru3OupM= Received: from BN9P220CA0013.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::18) by BL1PR12MB5780.namprd12.prod.outlook.com (2603:10b6:208:393::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.18; Thu, 18 Jun 2026 05:32:47 +0000 Received: from BN2PEPF0000449F.namprd02.prod.outlook.com (2603:10b6:408:13e:cafe::4d) by BN9P220CA0013.outlook.office365.com (2603:10b6:408:13e::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.113.18 via Frontend Transport; Thu, 18 Jun 2026 05:32:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BN2PEPF0000449F.mail.protection.outlook.com (10.167.243.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.139.8 via Frontend Transport; Thu, 18 Jun 2026 05:32:47 +0000 Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 18 Jun 2026 00:32:46 -0500 Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 18 Jun 2026 00:32:46 -0500 Received: from [10.136.46.240] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Thu, 18 Jun 2026 00:32:36 -0500 Message-ID: Date: Thu, 18 Jun 2026 11:02:30 +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: Shrikanth Hegde , Yury Norov CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <20260617174139.155540-1-sshegde@linux.ibm.com> <20260617174139.155540-15-sshegde@linux.ibm.com> <834b0300-2e5f-41dd-9b2d-2056256c1fdd@linux.ibm.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <834b0300-2e5f-41dd-9b2d-2056256c1fdd@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF0000449F:EE_|BL1PR12MB5780:EE_ X-MS-Office365-Filtering-Correlation-Id: 12712ac6-70e5-44a5-9786-08deccfb07be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|23010399003|376014|36860700016|82310400026|6133799003|18002099003|22082099003|4143699003|11063799006|56012099006; X-Microsoft-Antispam-Message-Info: xLEiUNDyeWwmGEXzMxBUEtO6uFeJDd7SN08syhGgc+K4Rz5TqqeXXszDUvPa0ugZxTxVaL4wDkAJA1BpGBElm8MvF+QajHsHp1HdF/3/3X3r4lNHncWRjkk7huwpqCDwJYdGFd2s4KMSHQJgEGcDkJ3TEJfh6tnVCgmlyZ4imZtQXxBLgxWYfCzjMWfUKIhekbcXxUWwfyj84SXxGUmkUBchEPDas2qO1dssgiJA4HM4OzqgJPP/gdD2hioNf1W3c/BerVcKbiJkgB1NRv0JgTTkeD9+7BZr3RST7FPsIzWAEbAJUeDYhdGDluB6nKOcP8inIUPtsWQV8eLEk8b1HZYuaiBP1JfW+jkNCg7fupPovSkTBQy4AlVjd5ocDRU0FMKX9RChU+d8CjOVA+9tJi9UL+DwtgOWASOYT6n1vKODwvf1FHgOe6lrQ8xnG6UwuFHhsLiaODlIUPpyhweXoNQzQrz16wcKgt8O71sUHdMvtSWlXSP/kNq+E0kn4wueQaSqxrXJjkqpV3jQJptOxoFSUVXQUW4oXVyJCAyLrYYc3uMBLD6g/TGRZ3hWTe4NSyqAeg0U8CSOwWDtpZE8PjDv+wsi3R1mRJ+i8emCH4fXzrx3Re2uvGVM6D6YmV7BunLwP+oaEWpCs7UoV1I9pINb3SK6lSIpspvffVZIF0TDEjFyYSq+dMfIb007WKKwqkSwtABhw2KL12A3OaMvA1Z6nxrTqajta/5TifJ6ZwQ= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(23010399003)(376014)(36860700016)(82310400026)(6133799003)(18002099003)(22082099003)(4143699003)(11063799006)(56012099006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EaKoRTn9l9heBjgVIJQ5Po3xr+rYDfVtqAxLSuZWsYO0NmI3aTbVZj7uYJktId/u5ili7os+mwVLLESiW+ns6zmsTx95dUiL2in9UX33Bx+dGlH8y+J4jZmPKF35Tq0fvDf+ppoUvtcQcErJwClOwysWV+kndJpT33Uv5bjOU8H+39ggpI5s83l3RAcwp7r3LRt2fRsVpNtPC1gJkdi+KO3g+xsMrCgx7yTvh7+v+Kaf0yQyKNCEMa2qKF+g2Us4ySKdPQRUb40+dzqKiWOvZhkKx8wTX4kiI7vApGBX4vurfvljAKZr1XJmdhCtqHY+TeMFOHj+yuID94KbmBa2vgGcTQiBGvaUa+Gp4CStwky+elKu/QxCZ30dFRfpCvb4GyuOM0ZUJBefg5mKma2Muj7ATJyjADdNpvC+/wyL+LynMEpC7BYPHRGla9BR//Cf X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2026 05:32:47.1549 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12712ac6-70e5-44a5-9786-08deccfb07be X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF0000449F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5780 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. 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. -- Thanks and Regards, Prateek