From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6E2B330324 for ; Thu, 18 Jun 2026 06:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781764780; cv=none; b=eWj5SeM9YpNjTdfwEUUHIzXwvFOscm64W18gzxHL0NUnXTZQwm+NMkoxgNi7LLV2Hc9Np9iGb8nZ2Rt55PLnnFQmbxYNdg70j0N+y0QGyFgZ48FT1tqrIqYORsmgZSXTM3E8MNjXqt75L/xfbQEwwS/W6P13Qsu2dFD8XzqJnkc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781764780; c=relaxed/simple; bh=K5Jc8nb6buE1W8WPo+cvaDGSQnq6SX+vBXNvr2JRLnY=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CavrSFpw4ElLgJ39Bvfq3Zg/k9W594lQ/TqD1DDxZ7g/LAid/5j/z47mpUAjG61OFA75KdDMXKkD4Cwfvklj8ROM8a66z5aC6E1VVcx/pWzVAT+WTzFbfa+QH3v+25S9uQ5BWCLADt7++slxYqzP6tRH+YWcOrK3BwnnAgU6CoY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=frTJKlcA; arc=none smtp.client-ip=209.85.128.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="frTJKlcA" Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-8000e21f014so2618807b3.2 for ; Wed, 17 Jun 2026 23:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781764778; x=1782369578; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=Pm7WaTovmYhaEEQnBhHcMGj91tHpDSINkKtqdau15hE=; b=frTJKlcAio6kaFNNQujewYvpwO0fHNT79+oF1FTr+q3MoGs63NO6b9Ub9VfhCaucki XTekQmeSuhj8PDRccXFITZYpaRzzPa5wbcHVqbWolkEKjft25FpGfXw9MlQD0OPQolIw TbWMgOoyR4FBuvvJy3FOuQ/Asj3/zyNRhlGIRGJelXHPCIThO4rH31de8EDxuL/P/Vlw 896Gn5HRVvPvtcJaCZTRWe8HrmCTHMkRZfLrkJ49JGmnSu7GnaESUgCAZyaj7SKY+lgo lISHRLVVVUDD0Ddv7n4RC+5koG5fz9f+3H2HSt4kkg120sHWFq4mytwdiSaYnUfnIaga t8lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781764778; x=1782369578; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Pm7WaTovmYhaEEQnBhHcMGj91tHpDSINkKtqdau15hE=; b=iRjvpRa7OlfreHSNu+zR+ejrJdaKPTrEXWqPGWobgCrfza5srTn8BvovIuHIvlp24K v1QZFATKkXiJw7lLVMEu3FQu0ywR5NWGVKgxEdLc21B8QwIIpB0mNGBfslQz+zzrvoPQ CBYOmmNG07XqZEA5r0YY/9Wd9ApWXUs1YDiBOAM3auAMQEOpqVs6vFYQRBDEBMLUY9Sb etSXgGWwoCYwDzRUHEQ1IwJZRrJIijwZi0wdPJUWy50eDVvXXofZ6jY1nZkmIB0GZAVM hWcUcG9JWDg/PqbsfwugGJgtMpxiy+rwgh77MCbiNy0ihDHNYhDPWjkBlzi+iRvBOA+7 25vQ== X-Forwarded-Encrypted: i=1; AFNElJ+g2JDDhMslMlPN7uwCbhXF34sIFSB9P6TykhXOmx8C+cENn5eYuI+gwdk2DZ8MhpntmrW2erXvi+CQQdg=@vger.kernel.org X-Gm-Message-State: AOJu0YzIKgoqHovM1oDgjSywHMFlDIAYu8kUdzBuehub1Num2e6y5HEy rsaflDtrUcJQCct5PR2I2cVg2QeUphG61ZqOo6HINT2oyZU1gXdwCS1i X-Gm-Gg: AfdE7cnId8izw6S5HY+jlUEeKfJODMZMmNEEqa2YR8YVXFtKOdn8+q7RRv/vmJhEILb nlH7cocuAQk2REC1wdJsV26LlLIFKg0G5tV3xz49uvcbT/ktV8YdWomzpUFPGSSD+vPJUfci3dY NibFY/PnA7GGtb7+AGfPEKvXnkB8bMKxJwBge6X5T8MxKjs5JFgEzfArYgET1FSgwEHCoRJfVK/ y44Ms0MJs7ODLj36mq3sXIRDetqg5RDK+yewuDXl2AddQsS2D8t7CXyxT4b78X+78rBmJJVo8xa R4/TPDZKYAapXrXcVKr23H7SHhs+m0Po9t/NoiGcc0wo5zhXxn25VkQDDCRWVwXRJoqny5c/OJr wGpeQrSqaij9fGcM7v702rK8mb12ptJxp3h0H3oOFznNnmZXFKZE7ka1tclH00+no9L0BNvXI1U ZEBHWSMTwY1nhyHq87GiYgdoQCSbcC0PZuwrtwl8dfE20GZA== X-Received: by 2002:a05:690c:ecc:b0:7bf:424:bf6b with SMTP id 00721157ae682-7ffc564332cmr24511927b3.14.1781764777788; Wed, 17 Jun 2026 23:39:37 -0700 (PDT) Received: from localhost (syn-035-130-123-074.biz.spectrum.com. [35.130.123.74]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7fcd00d9db6sm66075037b3.6.2026.06.17.23.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2026 23:39:37 -0700 (PDT) From: Yury Norov X-Google-Original-From: Yury Norov Date: Thu, 18 Jun 2026 02:39:36 -0400 To: Shrikanth Hegde Cc: K Prateek Nayak , Yury Norov , 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 Subject: Re: [PATCH v4 14/20] sched/core: Introduce a simple steal monitor Message-ID: 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0319e8ae-3e7d-4ee1-93e3-424eb155aa7e@linux.ibm.com> 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. Thanks, Yury