Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Zqiang <qiang.zhang@linux.dev>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Zqiang and committed by
Tejun Heo
714d8142 ccaeeb58

+2 -2
+2 -2
kernel/sched/ext.c
··· 3439 3439 * operations inside scheduler locks. 3440 3440 */ 3441 3441 dsq->id = SCX_DSQ_INVALID; 3442 - llist_add(&dsq->free_node, &dsqs_to_free); 3443 - irq_work_queue(&free_dsq_irq_work); 3442 + if (llist_add(&dsq->free_node, &dsqs_to_free)) 3443 + irq_work_queue(&free_dsq_irq_work); 3444 3444 3445 3445 out_unlock_dsq: 3446 3446 raw_spin_unlock_irqrestore(&dsq->lock, flags);