[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6aa0d9b6-94f8-6321-9015-da56ac93d863@redhat.com>
Date: Wed, 14 Jul 2021 12:44:35 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Jason Wang <jasowang@...hat.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Juri Lelli <jlelli@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Al Viro <viro@...iv.linux.org.uk>,
He Zhe <zhe.he@...driver.com>
Subject: Re: 5.13-rt1 + KVM = WARNING: at fs/eventfd.c:74 eventfd_signal()
On 14/07/21 12:41, Michael S. Tsirkin wrote:
>> --------------- 8< ---------------
>> From: Paolo Bonzini <pbonzini@...hat.com>
>> Subject: [PATCH] eventfd: protect eventfd_wake_count with a local_lock
>>
>> 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@...hat.com>
>> Fixes: b5e683d5cab8 ("eventfd: track eventfd_signal() recursion depth")
>> Cc: stable@...r.kernel.org
>> Cc: He Zhe <zhe.he@...driver.com>
>> Cc: Jens Axboe <axboe@...nel.dk>
>> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
>
>
> Makes sense ...
>
> Acked-by: Michael S. Tsirkin <mst@...hat.com>
>
> want to send this to the windriver guys so they can test?
> Here's the list from that thread:
I included He Zhe, but it should be enough for Daniel to test it. The
bug is quite obvious once you wear your PREEMPT_RT goggles.
Paolo
Powered by blists - more mailing lists