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

Re: [PATCH] xen/locks: add dynamic lock recursion checks


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 8 Sep 2022 15:08:27 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Nd080d/W96RLhwf4IfX72LwUsiztqY2/mwC0sYSn8ys=; b=A4bDBy8s+UqHd6f9CQ+NmlL9LIBSvRZmhzawItme/2KICEPb8Yk0G0KUyKFsqPud2TEvulyHPUXsZe7HM2Ku0hHFPqzPhLgUVdxAfLTXXgV+cZndWpWbqQ4Eu4DSwgHZQVzXZn1Di+P9MfHDJqoBpGfF7jxi6Tqy3HNKCR96LbsABDc2ceEUJEC2OogH1z9frUsUXZbFBdLN3oax9VifO87TYswp13Pnx6cE5ceh2I91TJH4SA1to6K4KSjFJqeO9Dd722nWJerReIe5w1rD8ThuoNPPecjW/d35ja4LFGwPspn7GN3Bf6DVXMR2aXzrR/BDBl0U8og7Yrbq8Sq5/A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C+HOvvABwF7y48ieTVDjz11JGunpV1poH85wxSAGW6lEXoixaAsNA5X1A5JXxSDBDlgs3t1kQhPtZigWPDkATXA4VZG2/1dkO+L9CmdTaqd3O5DhDnmryTt27lj8n3LktGrExdbUC/x/WykvcqztMonYxE4zZB6w3sc0GlcR7DYpH/G+6OQMcxbmoSMjJS3Kzh4z0UAJ+hPalFnXGfaf3/aLX3YRr7BWZVUESbfqpZE9a4HlQ+1w3jp3QLlvc+nnHMkfTXLpyytzTjbkU4I1POKFZp0fGlOR8khXKjvJaKgDK2uEgak7mckxn1ENlrVI4qo7F+NfDI1E3k4og9iIEQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 08 Sep 2022 13:08:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.09.2022 09:46, Juergen Gross wrote:
> Add checking of lock recursion to the hypervisor. This is done by using
> a percpu data array for storing the address of each taken lock. Any
> attempt to take a lock twice (with the exception of recursive
> spinlocks) will result in a crash. This is especially meant for
> detecting attempts to take a rwlock multiple times as a reader, which
> will only result in a deadlock in case of another cpu trying to get the
> lock as a writer in between.
> 
> The additional checks are not performance neutral, so they are enabled
> only in debug builds per default, as the checks are active only with
> CONFIG_DEBUG_LOCKS enabled. The size of the percpu data array can be
> selected via a boot parameter.
> 
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> ---
> Further possible enhancements:
> - record address or file/line of locker, too
> - add sanity check when exiting hypervisor or going to idle that all locks
>   have been released
> 
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

But left in the queue for 4.18, ftaod.

Jan



 


Rackspace

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