From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arun Sharma Subject: Should shadow_lock be spin_lock_recursive? Date: Wed, 11 May 2005 10:42:54 -0700 Message-ID: <4282441E.6080900@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: "Ling, Xiaofeng" List-Id: xen-devel@lists.xenproject.org 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