From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: jiangshanlai@gmail.com, josh@joshtriplett.org,
rostedt@goodmis.org, mathieu.desnoyers@efficios.com,
Linu Cherian <linuc.decode@gmail.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH 0/2] srcu: allow using same SRCU in process and interrupt context
Date: Wed, 31 May 2017 14:03:09 +0200 [thread overview]
Message-ID: <1496232191-13439-1-git-send-email-pbonzini@redhat.com> (raw)
Linu Cherian reported a WARN in cleanup_srcu_struct when shutting
down a guest that has iperf running on a VFIO assigned device.
This happens because irqfd_wakeup calls srcu_read_lock(&kvm->irq_srcu)
in interrupt context, while a worker thread does the same inside
kvm_set_irq. If the interrupt happens while the worker thread is
executing __srcu_read_lock, lock_count can fall behind.
(KVM is using SRCU here not really for the "sleepable" part, but
rather due to its faster detection of grace periods).
As discussed with Paul, this patch changes __this_cpu_inc to this_cpu_inc
in __srcu_read_lock, thus removing the restriction that SRCU can only
be used in process context.
Split in two parts so that srcuclassic and header changes can be
backported to stable releases. Because of the backport, the two commit
messages are more or less cut-and-pasted.
Ok for 4.12?
Paolo
Paolo Bonzini (2):
srcutiny, srcutree: allow using same SRCU in process and interrupt context
srcuclassic: allow using same SRCU in process and interrupt context
include/linux/srcu.h | 2 --
include/linux/srcutiny.h | 2 +-
kernel/rcu/rcutorture.c | 4 ++--
kernel/rcu/srcu.c | 5 ++---
kernel/rcu/srcutiny.c | 21 ++++++++++-----------
kernel/rcu/srcutree.c | 5 ++---
6 files changed, 17 insertions(+), 22 deletions(-)
--
1.8.3.1
next reply other threads:[~2017-05-31 12:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 12:03 Paolo Bonzini [this message]
2017-05-31 12:03 ` [PATCH 1/2] srcutiny, srcutree: " Paolo Bonzini
2017-05-31 17:56 ` Paul E. McKenney
2017-05-31 12:03 ` [PATCH 2/2] srcuclassic: " Paolo Bonzini
2017-05-31 17:56 ` Paul E. McKenney
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=1496232191-13439-1-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=kvm@vger.kernel.org \
--cc=linuc.decode@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®