From: Nicolas Saenz Julienne <nsaenzju@redhat.com>
To: bristot@kernel.org
Cc: axboe@kernel.dk, bigeasy@linutronix.de,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
pbonzini@redhat.com, stable@vger.kernel.org, tglx@linutronix.de,
viro@zeniv.linux.org.uk, zhe.he@windriver.com,
Nicolas Saenz Julienne <nsaenzju@redhat.com>
Subject: Re: [PATCH] eventfd: protect eventfd_wake_count with a local_lock
Date: Fri, 23 Jul 2021 16:53:04 +0200 [thread overview]
Message-ID: <20210723145303.272822-1-nsaenzju@redhat.com> (raw)
In-Reply-To: <523c91c4a30f21295508004c81cd2e46ccc37dc2.1626680553.git.bristot@kernel.org>
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@kernel.org>
> Fixes: b5e683d5cab8 ("eventfd: track eventfd_signal() recursion depth")
> Cc: He Zhe <zhe.he@windriver.com>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: stable@vger.kernel.org
> Cc: linux-fsdevel@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Co-developed-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
> ---
Tested-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
Thanks!
--
Nicolás Sáenz
prev parent reply other threads:[~2021-07-23 14:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-19 7:54 [PATCH] eventfd: protect eventfd_wake_count with a local_lock Daniel Bristot de Oliveira
2021-07-23 14:53 ` Nicolas Saenz Julienne [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210723145303.272822-1-nsaenzju@redhat.com \
--to=nsaenzju@redhat.com \
--cc=axboe@kernel.dk \
--cc=bigeasy@linutronix.de \
--cc=bristot@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
--cc=zhe.he@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).