From patchwork Mon Sep 9 14:31:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11138119 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A31714DB for ; Mon, 9 Sep 2019 14:33:01 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3FDAF206A1 for ; Mon, 9 Sep 2019 14:33:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FDAF206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i7Khl-0001PJ-Mn; Mon, 09 Sep 2019 14:31:45 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i7Khj-0001OK-TC for xen-devel@lists.xenproject.org; Mon, 09 Sep 2019 14:31:43 +0000 X-Inumbo-ID: 8804fb51-d30e-11e9-ac0d-12813bfff9fa Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8804fb51-d30e-11e9-ac0d-12813bfff9fa; Mon, 09 Sep 2019 14:31:38 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 45FB3B65C; Mon, 9 Sep 2019 14:31:37 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Mon, 9 Sep 2019 16:31:29 +0200 Message-Id: <20190909143134.15379-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH v4 0/5] enhance lock debugging X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" While hunting a locking problem in my core scheduling series I have added some debugging aids to spinlock handling making it easier to find the root cause for the problem. Making use of the already existing lock profiling and enhancing it a little bit produces some really valuable diagnostic data e.g. when a NMI watchdog is triggering a crash. Changes in V4: - some comments by Jan Beulich addressed - replaced patch 5 with another approach to make lock names unique Changes in V3: - rebase to current staging (after realizing that patch 4 still applied, but resulting in patching a wrong function) Changes in V2: - multiple comments addressed - added patch 5 Juergen Gross (5): xen/spinlocks: in debug builds store cpu holding the lock xen: add new CONFIG_DEBUG_LOCKS option xen: print lock profile info in panic() xen: modify lock profiling interface xen: add function name to lock profiling data tools/libxc/xc_misc.c | 1 + tools/misc/xenlockprof.c | 17 +--- xen/Kconfig.debug | 10 ++- xen/arch/arm/xen.lds.S | 13 ++-- xen/arch/x86/domain.c | 2 +- xen/arch/x86/xen.lds.S | 13 ++-- xen/common/domain.c | 4 +- xen/common/keyhandler.c | 2 +- xen/common/spinlock.c | 185 ++++++++++++++++++++++++++++++++------------ xen/common/sysctl.c | 2 +- xen/drivers/char/console.c | 4 +- xen/include/public/sysctl.h | 11 +-- xen/include/xen/spinlock.h | 75 +++++++++++------- 13 files changed, 221 insertions(+), 118 deletions(-)