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

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


  • To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
  • From: Jui-Hao Chiang <juihaochiang@xxxxxxxxx>
  • Date: Fri, 7 Jan 2011 00:11:59 +0800
  • Cc: tinnycloud <tinnycloud@xxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 06 Jan 2011 08:12:45 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=XX+NEgQexiEadTVvQvDIRTec8ijbdZTninEQeUQOayFsNF00HjaViyD6/v0TjnvHe5 HsqxPJ/KBzXvCvhKBxcpbs6QygJT8GIKH1M58DaFq3QIc6JhciAVxQb9uO8xljEs4+iU jDs5DDthAT0OKB/j8mEvOiqud26iC+aesRyBc=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi, this patch does the following
(1) When updating/checking p2m type for mem_sharing, we must hold shr_lock
(2) For nominate operation, if the page is already nominated, return the handle from page_info->shr_handle
(3) For unshare operation, it is possible that multiple users unshare a page via hvm_hap_nested_page_fault() at the same time. If the page is already un-shared by someone else, simply return success.

NOTE: we assume that nobody holds page_alloc_lock/p2m_lock before calling nominate/share/unshare.

Signed-off-by: Jui-Hao Chiang <juihaochiang@xxxxxxxxx>
Signed-off-by: Han-Lin Li <Han-Lin.Li@xxxxxxxxxxx>

Bests,
Jui-Hao

Attachment: mem_sharing_p2mt_race.patch
Description: Text Data

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