mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Zqiang <qiang.zhang@linux.dev>
Cc: tj@kernel.org, void@manifault.com, changwoo@igalia.com,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched_ext: Fix some comments in ext.c
Date: Sat, 20 Dec 2025 00:00:47 +0100	[thread overview]
Message-ID: <aUXZHx1Hzmp7xksq@gpd4> (raw)
In-Reply-To: <20251219093404.382-1-qiang.zhang@linux.dev>

On Fri, Dec 19, 2025 at 05:34:04PM +0800, Zqiang wrote:
> This commit update balance_scx() in the comments to balance_one().
> 
> Signed-off-by: Zqiang <qiang.zhang@linux.dev>

Maybe we can mention that balance_scx() was removed by commit 4c95380701f58
("sched/ext: Fold balance_scx() into pick_task_scx()"). Now balance_one()
is called directly from do_pick_task_scx() and does all the work that used
to be handled by balance_scx(), so the renames are correct.

In any case, looks good to me, thanks for the cleanup.

Reviewed-by: Andrea Righi <arighi@nvidia.com>

-Andrea

> ---
>  kernel/sched/ext.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 7a53d1cf8e82..5ebf8a740847 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -1577,7 +1577,7 @@ static bool dequeue_task_scx(struct rq *rq, struct task_struct *p, int deq_flags
>  	 *
>  	 * @p may go through multiple stopping <-> running transitions between
>  	 * here and put_prev_task_scx() if task attribute changes occur while
> -	 * balance_scx() leaves @rq unlocked. However, they don't contain any
> +	 * balance_one() leaves @rq unlocked. However, they don't contain any
>  	 * information meaningful to the BPF scheduler and can be suppressed by
>  	 * skipping the callbacks if the task is !QUEUED.
>  	 */
> @@ -2372,7 +2372,7 @@ static void switch_class(struct rq *rq, struct task_struct *next)
>  	 * preempted, and it regaining control of the CPU.
>  	 *
>  	 * ->cpu_release() complements ->cpu_acquire(), which is emitted the
> -	 *  next time that balance_scx() is invoked.
> +	 *  next time that balance_one() is invoked.
>  	 */
>  	if (!rq->scx.cpu_released) {
>  		if (SCX_HAS_OP(sch, cpu_release)) {
> @@ -2478,7 +2478,7 @@ do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx)
>  	}
>  
>  	/*
> -	 * If balance_scx() is telling us to keep running @prev, replenish slice
> +	 * If balance_one() is telling us to keep running @prev, replenish slice
>  	 * if necessary and keep running @prev. Otherwise, pop the first one
>  	 * from the local DSQ.
>  	 */
> @@ -4025,7 +4025,7 @@ static DEFINE_TIMER(scx_bypass_lb_timer, scx_bypass_lb_timerfn);
>   *
>   * - ops.dispatch() is ignored.
>   *
> - * - balance_scx() does not set %SCX_RQ_BAL_KEEP on non-zero slice as slice
> + * - balance_one() does not set %SCX_RQ_BAL_KEEP on non-zero slice as slice
>   *   can't be trusted. Whenever a tick triggers, the running task is rotated to
>   *   the tail of the queue with core_sched_at touched.
>   *
> @@ -6069,7 +6069,7 @@ __bpf_kfunc bool scx_bpf_dsq_move_to_local(u64 dsq_id)
>  		/*
>  		 * A successfully consumed task can be dequeued before it starts
>  		 * running while the CPU is trying to migrate other dispatched
> -		 * tasks. Bump nr_tasks to tell balance_scx() to retry on empty
> +		 * tasks. Bump nr_tasks to tell balance_one() to retry on empty
>  		 * local DSQ.
>  		 */
>  		dspc->nr_tasks++;
> -- 
> 2.17.1
> 

  reply	other threads:[~2025-12-19 23:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19  9:34 Zqiang
2025-12-19 23:00 ` Andrea Righi [this message]
2025-12-23  2:31 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aUXZHx1Hzmp7xksq@gpd4 \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiang.zhang@linux.dev \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome