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 696F132E73E for ; Thu, 18 Jun 2026 07:16:27 +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=1781766988; cv=none; b=M8S5YMnQ5HAYLJ4wax74kIZ8qfZhSgilmRejN4TqHO8Geb/BCPsvfmg8AmJGhqRIY4LneQ8oKTNfksSBW6U5PfBUSL0hcnvBB9u4Fiw0LsuI9ZNn/lKk/xJP6p+fectSK+5ZQInlozpaJwFI5jS1E9RculGo9uH7O+ve9VPSF50= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781766988; c=relaxed/simple; bh=PF6NPXRjCyEQMXhew95q+PjHgm/XmRwgDbYl4WngoYg=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Qpz4lU1LB01Cw7f9tQ6iXjNN/C8fkBmP12AiXYJDDvU7ky91IX7IT3U1qOIv1NCP0mOukFnoQNSaU2Sfe1IL/Q7HqLm25aqxPIoNilCoej9HsXiwpkTKvv1QPSJZBwC3guV9YUU5S6LWCOGewUNwo+zvbf9EnjingLdePTnuJCY= 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=mJOSlH0h; 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="mJOSlH0h" Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-7e2fd65f968so6444447b3.3 for ; Thu, 18 Jun 2026 00:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781766986; x=1782371786; 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=4Or05BqHJbjmn2UnagUFV+CTCKMmNz7jvWNPqHEcNQg=; b=mJOSlH0hco74N3YIhKJ/2EZaiYCqym2jdfDt8gzJqtXzD9bW3hNXmgqoi4P6nTkbie lkvvNkZrWOYwXHMBrNKjbvtjPHEyh5Zx6C0nK0f+KcesNxWpfSFXSP7ukgyDQtAehZnZ Uzn4Abu1NfrS8DWvd/VKxBYUFcZv6BrPN24T5e/U04L7nfOul2F58ftOf1qscbRM+QRt EtMgeB5VwfKP9Tse+SQpc0Ncta8QoeNGbjf+eZFeofIXBHwLT3mZ6YaNKvQoBVrZ8b8Y qkSSwZbB4VkbyUVNUw3CdCVWyuei9rtzViCBMBVv5XbAN/sf+WaNo3M49YWdHXfdABZv a7yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781766986; x=1782371786; 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=4Or05BqHJbjmn2UnagUFV+CTCKMmNz7jvWNPqHEcNQg=; b=q7cloJ1JPPMUW6e0GdaXs8xqaLcacjG01IWnJAHZlMbiI8Ha54AALOtn8up+ayb+eK kx0huZ9nFvhiBRGYTjFJ2Rxcs2dYds6n3XQfGDrtkp9X8nIOCJCjk5EqYReF99VvKJTB 3Jm15gfip+cUbN2tDAFtkEaIuv6OvaxyOqR+5gyWNIWTEc9wGOKc+KZrHYF3QPvR97/S mNq9/9cP2UtueQA71OHRIpnQ+XLPTPguHwwv069nlkPLxqgEvg3Injy6JKS40C3Fj/tX pp5ZukQ/A1w4K60BOyRb+YVhHF9Po5hiQlAiXA8+r/ayXyCaResxkhdoK0EcTFuYGdq0 fe9w== X-Forwarded-Encrypted: i=1; AFNElJ8p48c2iH75Y0GnOjfFhMZtWb8e604mWsmHIboEgttEudmqlmrbl4qMqQmjB3FLLOfdQfvNaIbqrU/Qtdk=@vger.kernel.org X-Gm-Message-State: AOJu0YzHGxbUsLNtSCbpm2YN5QXm+zRJNk9aWmB4UlfUO6H7oXLKT20Z 91FSNCujRES+uRUfPWvJDNUI8Nj9UNCwmcL+1hwrSxX19/ml2kd2+G+n X-Gm-Gg: AfdE7ckIWFn7o7Eov8Cyl0HLoeKlbAzA/HiMayKRsjMWU2HkZ3s5d7F81akM5GPb4D+ Qp8hGzojF09G8Myb5Bgv/8KqwYJJD4weLRY0489Xk4aH8xfrIe6IQjD+buAsMg17zrOQHgVccfT eh2v9UW26h+0kBxmAQ/miLeds51XyJdLHTORpiteSz008iLerVHaptNqOWh4R9CNMqwCYWYZAt+ ilziZ1d+2V72YHs5+AokrYFozPk5HgPvLS3K+gM/Cli5tGrVWCYfOt8MehDLjTOmjpF5vLKBC22 IiAVgjTpfKoU/Y6jgWynE14IY40WuqpQ13eq3ORqHwch+XoU3prpU13j9NW+1gvbyjSPap7lqYG 9eF06sv7wI/RvCn7fa+iW7ZzHfAO4fj+fKQktVbq70Jl9Xkrg/PqkmOJ1pFvoQpDpiSvTGq72vo u29p+Sg9rXetm/p/97uyP/KE3LnJfRd5UH6aOBc6LzNsK+Ew== X-Received: by 2002:a05:690c:d0e:b0:7dd:1e9c:96af with SMTP id 00721157ae682-80027155c1bmr10910217b3.30.1781766986353; Thu, 18 Jun 2026 00:16:26 -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-7ff07773d5csm30126197b3.24.2026.06.18.00.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 00:16:25 -0700 (PDT) From: Yury Norov X-Google-Original-From: Yury Norov Date: Thu, 18 Jun 2026 03:16:25 -0400 To: Shrikanth Hegde Cc: Yury Norov , 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 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: On Thu, Jun 18, 2026 at 12:15:16PM +0530, Shrikanth Hegde wrote: > > > > 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 Those are the driver defaults. And if you want to override one, then: insmod steal_monitor.ko high_threshold=400