From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 2043F3D88FF for ; Wed, 18 Mar 2026 13:44:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773841455; cv=none; b=tueEUWe1++MhfPJkY/vxg+j1n/hE5DuIQwEz+7/aDqp3B8N7EtW+tyMqqEnZj5TNQWcrDcfY4LlZ6qr3dXBwKP0OzhU1uF/5FZysL070WVm/SeugRsG/nU0LhuwtF+sATWx97bpOLqEcowARJ3WKXfl23jjwALpWxCNvcNwOhqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773841455; c=relaxed/simple; bh=DtG8sV3G/Q2rYUdnUck0RTK6wZvClAG9yTQcorpE5E8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iZLeWzgkB5/DnfoJmUesUBshwh5d/18zVXruzhIoIpTmcvAOds9bbPR5AjxDoaCjSJIkgm3Fo3rlBJCl9ywjYhF5EzGc+77k7jM22JfyabE7rjDAaLUk/EyE9vVk/EAJcCfI6lufiZ1nCs+pGOxUCd+oKKkKgURImwEbkS8PMuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io; spf=pass smtp.mailfrom=layalina.io; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b=xoJo+Drf; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=layalina.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b="xoJo+Drf" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-6611e4aefdcso1427445a12.3 for ; Wed, 18 Mar 2026 06:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1773841452; x=1774446252; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ozqrTwQ0XqkoLrwxTiKJug576ya4+mYFrYcuEZ5t8c0=; b=xoJo+Drf7RSmmyKI3zqeZ709u05Y7I1ZmCAGda/qK5EX4M1OufN6pZeXQ9dPK1o6aK DOedZmMsmUMKY0iYRvgvCg0zvrOYJfjq2Zad1reLygPSOIeB/+39ZNzYEtWdlsxQoBHX MuPEU0pQDvrky1gNYKCVVKE7xylSukBLQqZwenvouJHWHph7RCmQ4rYWU4q25gVeLixI Y0tctQmOtdFb3b3l5nkbWvMHKaNiM6wyVrulWVgQnr1DE7dhKLu5V73TN7ZGdj2Mv+RQ GZ3HPegSUfy38s4TgoKL/l37o4YntVl8kv7SVwUlIvDllHOXCJI9gkcUNvHzhxkrXYef WlNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773841452; x=1774446252; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ozqrTwQ0XqkoLrwxTiKJug576ya4+mYFrYcuEZ5t8c0=; b=Jc3tWyLka5LBZa3GJq2sPmjrQjVw7a5CePGItsZUCtuT7zAopuGzPQhusaFN6Jdaeo B5yRY/FrIZNRE/1lWIDft3fVWmzVVyoaoSCf6ibBpl0yp8Qp5r/p1oLvwEgYp30Yc4Mt IIELywFI/BXCtaEeVIMCYGWH18izaZ9E3WR1IJ3RKPh4ZoVN3KfSabq/srjcokjyFG4g Wc95FY3v1RIc+boumbl5gg8Cb6Ctco0ygw7sD8K3pPeJNp5je64vtwd/tZpoQIG1+q5C PbtYFSErG+sUyPYTn+5LCG0oKbVKiKh/AiXauFMteDti4TJ4qkMmL7boL/R7bIx9MF1A K5Ow== X-Forwarded-Encrypted: i=1; AJvYcCWP1YJPF3tjzPBc5W9UH1MP1LrpgkLDoIQexlwujasha0BlH3RCdrXL9wWDXKNXx0GGGNve4LQUCJLXWTU=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1U1CIW6YBSj++eB50E7kJQXwkzPCrCySopsKBSHcib1nL33m0 cny4ynxFx4FjOZPHXUjQ3h56yee3BPYd4tW4U5avlZnCxsjauHg50MRythLmI16WVX8= X-Gm-Gg: ATEYQzxv3yqrRCIH+kvt/i3Eh47RBZfbqOYSaYqPPrzp4Xr4SBEQoCXzBuV7R0zO4C3 YbvqfZSiC6BrpYX2vpLTauukahRMOmGwXuoUtPN5tkfYFPKeZ07rRFtkZ2AG7WrkCz8iwZcB8o0 3v3Am44hHouzBv4jDLw2cP7YJG2PUxPD8Syv3XdeQ8qIIKk3/jGYULaiQN1RzF8NQ75QXnr6d2P IfDZfxHtFWPFw1z4x4JBjsHW8dk7mhnn6SzJC4toVo3F7K8vowWFuA4O2Ij09NlvwH5doH6w+LP EVpgYqS6PA2SfYEaIXFODoRTRn1FbbXkUw58pZ3fU2RJw4Jy8fIh0fYB47KNfPYHR25G11J7QwO NHuTzohpCHraFY36hxJtsnUR48dnD+HbkK8GM1wf7nwGaffyZexCuKU8HTZR9WeeUbEGHguT55r nIScvBWpBzzPlvF8uVQw== X-Received: by 2002:a17:906:478f:b0:b93:edc0:e2e8 with SMTP id a640c23a62f3a-b97f4b63802mr212803566b.48.1773841451250; Wed, 18 Mar 2026 06:44:11 -0700 (PDT) Received: from airbuntu ([194.36.110.150]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b97f1686a4asm228648366b.29.2026.03.18.06.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 06:44:09 -0700 (PDT) Date: Wed, 18 Mar 2026 13:44:06 +0000 From: Qais Yousef To: Vincent Guittot Cc: Peter Zijlstra , Xuewen Yan , mingo@redhat.com, juri.lelli@redhat.com, tj@kernel.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, lukasz.luba@arm.com, linux-kernel@vger.kernel.org, rui.zhang@intel.com, di.shen@unisoc.com, ke.wang@unisoc.com, xuewen.yan94@gmail.com Subject: Re: [RFC PATCH] sched: Add scx_cpuperf_target in sched_cpu_util() Message-ID: <20260318134406.6k23fct6dvpsqagm@airbuntu> References: <20260318121755.16354-1-xuewen.yan@unisoc.com> <20260318124718.GC3738786@noisy.programming.kicks-ass.net> 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=utf-8 Content-Disposition: inline In-Reply-To: On 03/18/26 13:55, Vincent Guittot wrote: > On Wed, 18 Mar 2026 at 13:47, Peter Zijlstra wrote: > > > > On Wed, Mar 18, 2026 at 08:17:55PM +0800, Xuewen Yan wrote: > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > > index bf948db905ed..20adb6fede2a 100644 > > > --- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -8198,7 +8198,12 @@ unsigned long effective_cpu_util(int cpu, unsigned long util_cfs, > > > > > > unsigned long sched_cpu_util(int cpu) > > > { > > > - return effective_cpu_util(cpu, cpu_util_cfs(cpu), NULL, NULL); > > > + unsigned long util = scx_cpuperf_target(cpu); > > > + > > > + if (!scx_switched_all()) > > > + util += cpu_util_cfs(cpu); > > > + > > > + return effective_cpu_util(cpu, util, NULL, NULL); > > > } > > > > This puts the common case of no ext muck into the slow path of that > > static_branch. > > +1 > I was about to same > > > > > This wants to be something like: > > > > unsigned long sched_cpu_util(int cpu) > > { > > unsigned long util = cpu_util_cfs(cpu); > > > > if (scx_enabled()) { > > unsigned long scx_util = scx_cpuperf_target(cpu); > > also scx_cpuperf_target() does not reflect the utilization of the CPU > but the targeted perfromance level Beside that, this sort of plug-and-play is a big concern. You picked up sched ext and changed the behavior, then you'd need to get your thermal management to work with that. Not retrospectively sprinkle these hacks around to force things to work again. This is a no from me. I think we have to keep the separation clear. And I haven't seen a single contribution back to scheduler out of these 'experiments'. Clearly everyone is going their own way and getting the threshold for us to get patches merged even higher not to break these out of tree 'experiments' is a big nuance. I think the sugov one was already a mistake to accept. > > > > > > if (!scx_switched_all()) > > scx_util += util; > > > > util = scx_util; > > } > > > > return effective_cpu_util(cpu, util, NULL, NULL); > > }