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

Re: [Xen-devel] Re: [PATCH] mem_sharing: fix race condition of nominate and unshare



On Mon, Jan 10, 2011 at 10:30 AM, Tim Deegan <Tim.Deegan@xxxxxxxxxx> wrote:
>> Just to be skeptic.
>> Why doesn't mfn_to_gfn() take p2m lock when querying the p2m type?
>
> Because gfn->mfn lookups happen very frequently and requiring the lock
> would be a performance bottleneck on multi-vcpu guests.

I think there's also a deadlock issue.  At some point a few months ago
I made ept_get_entry() grab the p2m lock, and it deadlocked with the
paging lock.  IIRC, the problem was that
* Sometimes the paging lock is grabbed after the p2m lock is taken
* Sometimes gfn_to_mfn() is called when the paging lock is held

So adding the p2m lock to gfn_to_mfn() gave you a circular lock
dependency, classic condition for deadlock.

 -George

_______________________________________________
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®.