Commit 714d8142 authored by Zqiang's avatar Zqiang Committed by Tejun Heo
Browse files

sched_ext: Avoid multiple irq_work_queue() calls in destroy_dsq()



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: default avatarZqiang <qiang.zhang@linux.dev>
Reviewed-by: default avatarAndrea Righi <arighi@nvidia.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent ccaeeb58
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3439,7 +3439,7 @@ 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);
	if (llist_add(&dsq->free_node, &dsqs_to_free))
		irq_work_queue(&free_dsq_irq_work);

out_unlock_dsq: