public inbox for linux-kernel@vger.kernel.org
 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: Avoid multiple irq_work_queue() calls in destroy_dsq()
Date: Mon, 22 Dec 2025 19:30:27 +0100	[thread overview]
Message-ID: <aUmOQ0PGzSGCmw9D@gpd4> (raw)
In-Reply-To: <20251222115318.18997-2-qiang.zhang@linux.dev>

On Mon, Dec 22, 2025 at 07:53:18PM +0800, Zqiang wrote:
> This commit only make irq_work_queue() to be called when the
> llist_add() returns true.

Just to be more clear, we could rephrase the commit message as follows:

llist_add() returns true only when adding to an empty list, which indicates
that no IRQ work is currently queued or running. Therefore, we only need to
call irq_work_queue() when llist_add() returns true, to avoid unnecessarily
re-queueing IRQ work that is already pending or executing.

> 
> Signed-off-by: Zqiang <qiang.zhang@linux.dev>

But overall, looks good to me.

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

Thanks,
-Andrea

> ---
>  kernel/sched/ext.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 8f6d8d7f895c..136b01950a62 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -3439,8 +3439,8 @@ static void destroy_dsq(struct scx_sched *sch, u64 dsq_id)
>  	 * operations inside scheduler locks.
>  	 */
>  	dsq->id = SCX_DSQ_INVALID;
> -	llist_add(&dsq->free_node, &dsqs_to_free);
> -	irq_work_queue(&free_dsq_irq_work);
> +	if (llist_add(&dsq->free_node, &dsqs_to_free))
> +		irq_work_queue(&free_dsq_irq_work);
>  
>  out_unlock_dsq:
>  	raw_spin_unlock_irqrestore(&dsq->lock, flags);
> -- 
> 2.17.1
> 

  reply	other threads:[~2025-12-22 18:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 11:53 [PATCH] sched_ext: Use the resched_cpu() to replace resched_curr() in the bypass_lb_node() Zqiang
2025-12-22 11:53 ` [PATCH] sched_ext: Avoid multiple irq_work_queue() calls in destroy_dsq() Zqiang
2025-12-22 18:30   ` Andrea Righi [this message]
2025-12-23 13:16     ` Zqiang
2025-12-23  4:00   ` Tejun Heo
2025-12-23 13:18     ` Zqiang
2025-12-22 18:16 ` [PATCH] sched_ext: Use the resched_cpu() to replace resched_curr() in the bypass_lb_node() Andrea Righi
2025-12-23  4:00 ` 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=aUmOQ0PGzSGCmw9D@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