Re: [PATCH 1/4] irq_work: Convert flags to atomic_t

Ingo Molnar
2019-11-11T08:01:05Z

* Frederic Weisbecker <frederic@kernel.org> wrote:

> We need to convert flags to atomic_t in order to later fix an ordering
> issue on cmpxchg() failure. This will allow us to use atomic_fetch_or().
> Also that clarify the nature of those flags.
>
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@kernel.org>
> ---
> include/linux/irq_work.h | 10 +++++++---
> kernel/irq_work.c | 18 +++++++++---------
> kernel/printk/printk.c | 2 +-
> 3 files changed, 17 insertions(+), 13 deletions(-)

You missed the irq_work use in kernel/bpf/stackmap.c - see the fix below.

Thanks,

Ingo

===>
kernel/bpf/stackmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index dcfe2d37ad15..23cf27ce0491 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -289,7 +289,7 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs,

if (in_nmi()) {
work = this_cpu_ptr(&up_read_work);
- if (work->irq_work.flags & IRQ_WORK_BUSY)
+ if (atomic_read(&work->irq_work.flags) & IRQ_WORK_BUSY)
/* cannot queue more up_read, fallback */
irq_work_busy = true;
}