Skip to content

Commit 47d9702

Browse files
committed
xen/events: fix delayed eoi list handling
When delaying eoi handling of events, the related elements are queued into the percpu lateeoi list. In case the list isn't empty, the elements should be sorted by the time when eoi handling is to happen. Unfortunately a new element will never be queued at the start of the list, even if it has a handling time lower than all other list elements. Fix that by handling that case the same way as for an empty list. Fixes: e99502f ("xen/events: defer eoi in case of excessive number of events") Reported-by: Jan Beulich <[email protected]> Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Oleksandr Tyshchenko <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent 50e865a commit 47d9702

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/xen/events/events_base.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,9 @@ static void lateeoi_list_add(struct irq_info *info)
604604

605605
spin_lock_irqsave(&eoi->eoi_list_lock, flags);
606606

607-
if (list_empty(&eoi->eoi_list)) {
607+
elem = list_first_entry_or_null(&eoi->eoi_list, struct irq_info,
608+
eoi_list);
609+
if (!elem || info->eoi_time < elem->eoi_time) {
608610
list_add(&info->eoi_list, &eoi->eoi_list);
609611
mod_delayed_work_on(info->eoi_cpu, system_wq,
610612
&eoi->delayed, delay);

0 commit comments

Comments
 (0)