lkml.org 
[lkml]   [2009]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2] kvm: remove in_range and switch to rwsem for iobus
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.

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



\
 
 \ /
  Last update: 2009-06-29 10:39    [W:0.064 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site