All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Avi Kivity <avi@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 12:51:32 +0300	[thread overview]
Message-ID: <20090629095132.GD19167@redhat.com> (raw)
In-Reply-To: <4A488D15.4060500@redhat.com>

On Mon, Jun 29, 2009 at 12:44:53PM +0300, Avi Kivity wrote:
> On 06/29/2009 12:23 PM, Michael S. Tsirkin wrote:
>> On Mon, Jun 29, 2009 at 11:37:00AM +0300, Avi Kivity wrote:
>>    
>>> On 06/28/2009 10:34 PM, Michael S. Tsirkin wrote:
>>>      
>>>> This changes bus accesses to use high-level kvm_io_bus_read/kvm_io_bus_write
>>>> functions, which utilize read/write semaphore intead of mutex.  in_range now
>>>> becomes unused so it is removed from device ops in favor of read/write
>>>> callbacks performing range checks internally.
>>>>
>>>> This allows aliasing (mostly for in-kernel virtio), as well as better error
>>>> handling by making it possible to pass errors up to userspace. And it's enough
>>>> to look at the diffstat to see that it's a better API anyway.
>>>>
>>>> While we are at it, document locking rules for kvm_io_device_ops.
>>>>
>>>> Note: since the use of the new bus_lock is localized to a small number of
>>>> places, it will be easy to switch to srcu in the future if we so desire.
>>>>
>>>>        
>>> Looks good. But please split into a locking change patch and an API
>>> change patch (in whatever order makes more sense).
>>>
>>> I think you can reuse slots_lock instead of adding a new lock. IIRC
>>> slots_lock is already taken for read everywhere, so you only need to
>>> take it for write when registering things.
>>>      
>>
>> IMO this will make it harder to convert to rcu down the line.
>> As it is we just grep for bus_lock and replace with rcu.
>> While possibly slots_lock can be converted to rcu as well,
>> let's do it one thing at a time.
>>    
>
> We can convert it to rcu indepenently of other things protected by  
> slots_lock; no need to do everything at the same time.

Yes but once we merge locks, it will be harder to split them out.
I know I can now do grep bus_lock and find all places affected,
if I reuse slot_lock this information is lost. No?

-- 
MST

  reply	other threads:[~2009-06-29  9:52 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 [this message]
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
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=20090629095132.GD19167@redhat.com \
    --to=mst@redhat.com \
    --cc=avi@redhat.com \
    --cc=ghaskins@novell.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markmc@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.