[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A4895A3.5040402@redhat.com>
Date: Mon, 29 Jun 2009 13:21:23 +0300
From: Avi Kivity <avi@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
CC: Gregory Haskins <ghaskins@...ell.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, mtosatti@...hat.com,
paulmck@...ux.vnet.ibm.com, markmc@...hat.com
Subject: Re: [PATCHv2] kvm: remove in_range and switch to rwsem for iobus
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists