On PREEMPT_RT most items are processed as LAZY via softirq context. Avoid to spin-wait for them because irq_work_sync() could have higher priority and not allow the irq-work to be completed. Wait additionally for !IRQ_WORK_HARD_IRQ irq_work items on PREEMPT_RT.
Showing the changes to kernel (1 of 2 files). Show all
Unified · Split
| @@ -217,7 +217,8 @@ void irq_work_single(void *arg) · 216 unmodified lines | |||
| 217 | */ | 217 | */ |
| 218 | (void)atomic_cmpxchg(&work->node.a_flags, flags, flags & ~IRQ_WORK_BUSY); | 218 | (void)atomic_cmpxchg(&work->node.a_flags, flags, flags & ~IRQ_WORK_BUSY); |
| 219 | 219 | ||
| 220 | if (!arch_irq_work_has_interrupt()) | 220 | if ((IS_ENABLED(CONFIG_PREEMPT_RT) && !irq_work_is_hard(work)) || |
| 221 | !arch_irq_work_has_interrupt()) | ||
| 221 | rcuwait_wake_up(&work->irqwait); | 222 | rcuwait_wake_up(&work->irqwait); |
| 222 | } | 223 | } |
| 223 | 224 | ||
| @@ -277,7 +278,8 @@ void irq_work_sync(struct irq_work *work) · 53 unmodified lines | |||
| 277 | lockdep_assert_irqs_enabled(); | 278 | lockdep_assert_irqs_enabled(); |
| 278 | might_sleep(); | 279 | might_sleep(); |
| 279 | 280 | ||
| 280 | if (!arch_irq_work_has_interrupt()) { | 281 | if ((IS_ENABLED(CONFIG_PREEMPT_RT) && !irq_work_is_hard(work)) || |
| 282 | !arch_irq_work_has_interrupt()) { | ||
| 281 | rcuwait_wait_event(&work->irqwait, !irq_work_is_busy(work), | 283 | rcuwait_wait_event(&work->irqwait, !irq_work_is_busy(work), |
| 282 | TASK_UNINTERRUPTIBLE); | 284 | TASK_UNINTERRUPTIBLE); |
| 283 | return; | 285 | return; |