[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] gntdev: switch back to rwlocks



On Fri, 9 Jul 2010, Jeremy Fitzhardinge wrote:
> On 07/09/2010 08:56 AM, Jan Beulich wrote:
> >>> Shouldn't this be solved in a way not depending on an implementation
> >>> detail (rw-locks being unfair in that readers can lock out writers
> >>> indefinitely)? Is it even certain that all arch-es implement rw-locks
> >>> in a manner compatible with this?
> >>>       
> >> any rwlock implementations that allow multiple readers will do: both
> >> mn_invl_range_start and gntdev_mmap only require a read lock.
> >>     
> > No - if an implementation forces further readers to spin once a
> > writer started its attempt to acquire a lock, the code after your
> > change still has the potential to deadlock afaict.
> >   
> 
> Yes, relying on this kind of behaviour from rwlocks doesn't pass the
> smell test.  rwlocks are just a performance optimisation for particular
> locking patterns; it should always be safe to implement them as plain
> spinlocks (or convert them into spinlocks).
> 
> I think removing the notifier calls from apply_to_page_range fixes the
> root of the problem.
> 
 
I agree that your mmu notifier patch should solve the issue as well.
Just remember to apply it to the stable branches, because the bug is
affecting them too.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.