WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: Should shadow_lock be spin_lock_recursive?

To: Arun Sharma <arun.sharma@xxxxxxxxx>
Subject: [Xen-devel] Re: Should shadow_lock be spin_lock_recursive?
From: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>
Date: Thu, 12 May 2005 09:57:24 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 12 May 2005 01:56:35 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4282441E.6080900@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4282441E.6080900@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510
This dead lock happened on VNIF code when enabled shadow mode.
The shadow_lock path is so complex and maybe using recurisve lock
is the easiest way to avoid dead lock currently before clearing
the path or splitting the lock .

Arun Sharma wrote:

During our testing, we found this code path where xen attempts to grab the shadow_lock, while holding it - leading to a deadlock.

 >> free_dom_mem->
 >> shadow_sync_and_drop_references->
 >> shadow_lock -> ..................... first lock
 >> shadow_remove_all_access->
 >> remove_all_access_in_page->
 >> put_page->
 >> free_domheap_pages->
 >> shadow_drop_references->
 >> shadow_lock -> ..................... second lock

Questions:

- should shadow lock be recursive?
- is shadow lock too coarse grained? It seems to have led to a lot of code refactoring (__foo without lock and foo with lock). But there may be more such instances we haven't found yet.

    -Arun


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