We need to convert flags to atomic_t in order to later fix an ordering issue on atomic_cmpxchg() failure. This will allow us to use atomic_fetch_or(). Also clarify the nature of those flags. [ mingo: Converted two more usage site the original patch missed. ]
Showing the changes to kernel/bpf/stackmap.c (1 of 5 files). Show all
Unified · Split
| @@ -289,7 +289,7 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs, · 288 unmodified lines | ||
| 289 | 289 | |
| 290 | 290 | if (in_nmi()) { |
| 291 | 291 | work = this_cpu_ptr(&up_read_work); |
| 292 | − if (work->irq_work.flags & IRQ_WORK_BUSY) | |
| 292 | + if (atomic_read(&work->irq_work.flags) & IRQ_WORK_BUSY) | |
| 293 | 293 | /* cannot queue more up_read, fallback */ |
| 294 | 294 | irq_work_busy = true; |
| 295 | 295 | } |