From: Gleb Natapov <gleb@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
kvm@vger.kernel.org, Avi Kivity <avi@redhat.com>
Subject: Re: [PATCH] kvm: get rid of srcu idx
Date: Tue, 26 Oct 2010 08:58:20 +0200 [thread overview]
Message-ID: <20101026065820.GJ2343@redhat.com> (raw)
In-Reply-To: <20101025201356.GA18436@amt.cnet>
On Mon, Oct 25, 2010 at 06:13:56PM -0200, Marcelo Tosatti wrote:
> On Mon, Oct 25, 2010 at 03:20:59PM +0200, Michael S. Tsirkin wrote:
> > On Mon, Oct 25, 2010 at 11:52:29AM -0200, Marcelo Tosatti wrote:
> > > On Sun, Oct 24, 2010 at 07:16:10PM +0200, Michael S. Tsirkin wrote:
> > > > srcu_idx is easy to misuse as it can not be used
> > > > in nested srcu_read_lock calls. Switch to local
> > > > index to make correctness easier to verify.
> > > >
> > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > > >
> > > > ---
> > >
> > > Looks good to me.
> > >
> > > Not needed for -stable, i don't see a problem with the current
> > > code?
> >
> > It's just that I can not convince myself current code never nestes
> > read_locks with srcu_idx. I used to see host crashes under migration
> > stress they seem gone now but did not retest - could be just luck.
>
> Well, you just changed where srcu index is saved. I don't see how it
> could make a difference in practice.
>
If there is nested call to srcu read lock if srcu_idx is stored in vcpu
nested call will override previous srcu_idx value and srcu unlock will
not be called on it, but it will be called twice on new srcu_idx value.
If srcu_idx is saved on stack this will not happen, no?
--
Gleb.
next prev parent reply other threads:[~2010-10-26 6:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-24 17:16 [PATCH] kvm: get rid of srcu idx Michael S. Tsirkin
2010-10-25 13:52 ` Marcelo Tosatti
2010-10-25 13:20 ` Michael S. Tsirkin
2010-10-25 20:13 ` Marcelo Tosatti
2010-10-26 6:58 ` Gleb Natapov [this message]
2010-10-26 7:57 ` Avi Kivity
2010-10-26 8:01 ` Gleb Natapov
2010-10-26 8:06 ` Avi Kivity
2010-10-26 8:53 ` Michael S. Tsirkin
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=20101026065820.GJ2343@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.