All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Gregory Haskins <ghaskins@novell.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	mtosatti@redhat.com, paulmck@linux.vnet.ibm.com,
	markmc@redhat.com
Subject: Re: [PATCHv2] kvm: remove in_range and switch to rwsem for iobus
Date: Mon, 29 Jun 2009 13:21:23 +0300	[thread overview]
Message-ID: <4A4895A3.5040402@redhat.com> (raw)
In-Reply-To: <20090629100645.GE19167@redhat.com>

On 06/29/2009 01:06 PM, Michael S. Tsirkin wrote:
>>> 2. if I do it before in_range removal it's a lot of churn:
>>> one of the reasons for code reorg is so that there are less
>>> places to change locking.
>>>
>>>
>>>
>>>        
>> I don't think you really need to change anything.  slots_lock is already
>> taken (except where you modify the list).
>>      
>
> Are you sure about this? I don't understand the code well enough, so
> this reuse of an apparently unrelated lock just makes me nervious.  For
> example what about emulate_instruction? It is sometimes called from
> svm/vmx without slot lock ...
>    

vcpu context always has slots lock taken IIRC, except when in guest mode.

It's not an unrelated lock; slots lock locks memory hotplug, we extend 
it to lock mmio_bus and io_bus hotplug.

I'd really like to avoid a proliferation of locks.

>> How about this:
>>
>> 1. add slots_lock for write when modifying the list
>> 2. change the api
>> 3. drop kvm->lock
>>
>> ?
>>      
>
> Looks like I will just have to bite the bullet and switch to RCU.
>
>    

You still need a lock to prevent concurrent modifications to mmio_bus 
(but can use kvm->lock for this).


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-06-29 10:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-28 19:34 [PATCHv2] kvm: remove in_range and switch to rwsem for iobus Michael S. Tsirkin
2009-06-29  8:37 ` Avi Kivity
2009-06-29  9:23   ` Michael S. Tsirkin
2009-06-29  9:44     ` Avi Kivity
2009-06-29  9:51       ` Michael S. Tsirkin
2009-06-29  9:57         ` Avi Kivity
2009-06-29  9:41   ` Michael S. Tsirkin
2009-06-29  9:53     ` Avi Kivity
2009-06-29 10:06       ` Michael S. Tsirkin
2009-06-29 10:21         ` Avi Kivity [this message]
2009-06-29 14:06 ` Marcelo Tosatti
2009-06-29 14:28   ` Avi Kivity

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=4A4895A3.5040402@redhat.com \
    --to=avi@redhat.com \
    --cc=ghaskins@novell.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markmc@redhat.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=paulmck@linux.vnet.ibm.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.