[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20210723145303.272822-1-nsaenzju@redhat.com>
Date: Fri, 23 Jul 2021 16:53:04 +0200
From: Nicolas Saenz Julienne <nsaenzju@...hat.com>
To: bristot@...nel.org
Cc: axboe@...nel.dk, bigeasy@...utronix.de,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
pbonzini@...hat.com, stable@...r.kernel.org, tglx@...utronix.de,
viro@...iv.linux.org.uk, zhe.he@...driver.com,
Nicolas Saenz Julienne <nsaenzju@...hat.com>
Subject: Re: [PATCH] eventfd: protect eventfd_wake_count with a local_lock
On Mon, 19 Jul 2021 09:54:52 +0200, Daniel Bristot de Oliveira wrote:
> eventfd_signal assumes that spin_lock_irqsave/spin_unlock_irqrestore is
> non-preemptable and therefore increments and decrements the percpu
> variable inside the critical section.
>
> This obviously does not fly with PREEMPT_RT. If eventfd_signal is
> preempted and an unrelated thread calls eventfd_signal, the result is
> a spurious WARN. To avoid this, protect the percpu variable with a
> local_lock.
>
> Reported-by: Daniel Bristot de Oliveira <bristot@...nel.org>
> Fixes: b5e683d5cab8 ("eventfd: track eventfd_signal() recursion depth")
> Cc: He Zhe <zhe.he@...driver.com>
> Cc: Jens Axboe <axboe@...nel.dk>
> Cc: Alexander Viro <viro@...iv.linux.org.uk>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> Cc: stable@...r.kernel.org
> Cc: linux-fsdevel@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
> Co-developed-by: Paolo Bonzini <pbonzini@...hat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
> Signed-off-by: Daniel Bristot de Oliveira <bristot@...nel.org>
> ---
Tested-by: Nicolas Saenz Julienne <nsaenzju@...hat.com>
Thanks!
--
Nicolás Sáenz
Powered by blists - more mailing lists