From patchwork Thu May 2 19:15:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Zanussi X-Patchwork-Id: 163281 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp6104098ill; Thu, 2 May 2019 12:16:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdo9cGMRoRxzxjT8fwlac0B+WWl3wjQXueXI4TofTRsT4SKJdKVB5t3iJM+xvO0MvHzgOY X-Received: by 2002:a17:902:6b47:: with SMTP id g7mr5427105plt.227.1556824570671; Thu, 02 May 2019 12:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556824570; cv=none; d=google.com; s=arc-20160816; b=EB/T7wqhR4uvmUhG649s+PNCwPg+ocfTJfcL2pjk5W4BM5KlRzkyJYVwZYqsv+o+51 Ensz52E0dmnubHz54xUab+WtzDOkH/m7+Qvy+kEVbMb399+gwWz/IbTwF1aNNS4LPfbt aTEI4S6MliWh7UpDll601rFGIkpw6fyIJNaMr8j7B/EwEzECV0vqured+9Qon1+W1YXk Sar1aV3ASbYyIq7e/NSt79lw4SEynlzKc9mn26mVrf1fhNI+94tvuKdc1vu2bUU1VoP3 wZwBByYnVWahnQb9qv1p1JLeUkUDmAELL2RoBs+DXFNepxdTs8L/Vdr7qS+yibGxTF38 Rn3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:to:from:dkim-signature; bh=GxvwyW+Vvb9yPX/7bUMF8tz1jpfc4D3KSQAp5IHa1JQ=; b=Ks9F1c+5CbrwY7F1nQZq7w3scAIw6mGZyeGaKwhjqrVGOrQiHbjZApkCobqTFjuObQ yGyIdRwG12uPhBth0b6QYeF67FPIkP8LT0uccDK1Ugtp22CgxwQfPLOJxD3+BNXRGjuu 15VOdu4tfRF+VnW5X45bLyNqaYUDP8k3ARb3CqySEBG6ODxTkDEhyqHjeXcRqfyFDJOt 7M5EZh5MxYTjWByEGd3zV56e5kK4dzMRtowlNE8CAukiT7A5V9IxurqnNE4sksbbc5K/ +n0dU+YtIpCKwBO9V/DiFFzp95/VyI1eEG3xjFyRHbJeFyvM9hj5f2GkIYbqhvlySwfm addg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ekPBI3vq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si17566plk.385.2019.05.02.12.16.10; Thu, 02 May 2019 12:16:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ekPBI3vq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726552AbfEBTQI (ORCPT + 30 others); Thu, 2 May 2019 15:16:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:33266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbfEBTQF (ORCPT ); Thu, 2 May 2019 15:16:05 -0400 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C52962133F; Thu, 2 May 2019 19:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556824564; bh=zTKiB59yTAOgeXBzuwna1gvCfKgXqxqkpL/Tomsj28c=; h=From:To:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=ekPBI3vq7auZZwdZAild0WCJENM03KV6CnckxH933Qnzjv5Zl2jn2Ai4o+Y3HHvny ujCQFwFfRrInuGl0HmX7gDDv25/vkPyonq6hrwCUCSGyXXyxAfNAq13Vhh/u7qcMDG q077FNxphmKvNqejhVkUKyWnsWZWLX4ZeSSPgPm0= From: zanussi@kernel.org To: LKML , linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Sebastian Andrzej Siewior , Daniel Wagner , Tom Zanussi , Julia Cartwright Subject: [PATCH RT 3/4] tty/sysrq: Convert show_lock to raw_spinlock_t Date: Thu, 2 May 2019 14:15:38 -0500 Message-Id: <7433082948d7d5062f1d3fbbcae07616a8e07a98.1556824516.git.tom.zanussi@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Julien Grall v3.18.138-rt116-rc1 stable review patch. If anyone has any objections, please let me know. ----------- [ Upstream commit db80c207bffd0f49e984e9889ce62279bc3abd6c ] Systems which don't provide arch_trigger_cpumask_backtrace() will invoke showacpu() from a smp_call_function() function which is invoked with disabled interrupts even on -RT systems. The function acquires the show_lock lock which only purpose is to ensure that the CPUs don't print simultaneously. Otherwise the output would clash and it would be hard to tell the output from CPUx apart from CPUy. On -RT the spin_lock() can not be acquired from this context. A raw_spin_lock() is required. It will introduce the system's latency by performing the sysrq request and other CPUs will block on the lock until the request is done. This is okay because the user asked for a backtrace of all active CPUs and under "normal circumstances in production" this path should not be triggered. Signed-off-by: Julien Grall [bigeasy@linuxtronix.de: commit description] Signed-off-by: Sebastian Andrzej Siewior Acked-by: Sebastian Andrzej Siewior Signed-off-by: Greg Kroah-Hartman Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Tom Zanussi Conflicts: drivers/tty/sysrq.c --- drivers/tty/sysrq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.14.1 diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index f97e7dac3a98..36ed02aa5575 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -206,7 +206,7 @@ static struct sysrq_key_op sysrq_showlocks_op = { #endif #ifdef CONFIG_SMP -static DEFINE_SPINLOCK(show_lock); +static DEFINE_RAW_SPINLOCK(show_lock); static void showacpu(void *dummy) { @@ -216,10 +216,10 @@ static void showacpu(void *dummy) if (idle_cpu(smp_processor_id())) return; - spin_lock_irqsave(&show_lock, flags); + raw_spin_lock_irqsave(&show_lock, flags); printk(KERN_INFO "CPU%d:\n", smp_processor_id()); show_stack(NULL, NULL); - spin_unlock_irqrestore(&show_lock, flags); + raw_spin_unlock_irqrestore(&show_lock, flags); } static void sysrq_showregs_othercpus(struct work_struct *dummy)