From patchwork Fri Nov 13 14:02:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903573 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 C724A138B for ; Fri, 13 Nov 2020 14:24:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA4FD22226 for ; Fri, 13 Nov 2020 14:24:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Oi7V+t3x"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xlFmjKxn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726707AbgKMOYS (ORCPT ); Fri, 13 Nov 2020 09:24:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbgKMOYR (ORCPT ); Fri, 13 Nov 2020 09:24:17 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC149C0613D1; Fri, 13 Nov 2020 06:24:17 -0800 (PST) Message-Id: <20201113141732.680780121@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=RnPutIEhghgoo536rGP1gany4COll9eV5Xh0J3bCRIo=; b=Oi7V+t3xMEVk/+5l6bz8QLaSNx3nUUoDN6UwYKH3pm2ZJbGJ8GLol3FoZmJPqe1Lh6/Dxh 1nFGYLlKHZhmFpXrxnk6JdbowHwTuGlO2STIeU8MeveK6O95OmP3Y/VreNOCTmosQKpltl PodJ580NczVuQOFpRgrs7SX4Ei9k8aBdoe6gjx9954mt69zvRCw8nwR76Sh7ec51WIle3i tn6ga8Tw6wzpm67El32MNj8AxrJlHq2DalzZhCV1JpZfLvMG75RYS9W5lWLRNni53vzQwG 5MLc2ApK4iDcWiRj9cBqcZj5cSawHc9QSGKYtcAM60QM6RanQU/pcQhN9wqsqA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=RnPutIEhghgoo536rGP1gany4COll9eV5Xh0J3bCRIo=; b=xlFmjKxnDnUjXDDS5b3QeICpxgLMcYIi4FZ/GuOqg1NYVyeTiU7BKlPKFqFLY+z+/eZi6x enZDTrTmo4YKGdAg== Date: Fri, 13 Nov 2020 15:02:08 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 01/19] parisc: Remove bogus __IRQ_STAT macro References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org This is a leftover from a historical array based implementation and unused. Signed-off-by: Thomas Gleixner Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org --- arch/parisc/include/asm/hardirq.h | 1 - 1 file changed, 1 deletion(-) --- a/arch/parisc/include/asm/hardirq.h +++ b/arch/parisc/include/asm/hardirq.h @@ -32,7 +32,6 @@ typedef struct { DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); #define __ARCH_IRQ_STAT -#define __IRQ_STAT(cpu, member) (irq_stat[cpu].member) #define inc_irq_stat(member) this_cpu_inc(irq_stat.member) #define __inc_irq_stat(member) __this_cpu_inc(irq_stat.member) #define ack_bad_irq(irq) WARN(1, "unexpected IRQ trap at vector %02x\n", irq) From patchwork Fri Nov 13 14:02:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903579 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 7BEF817D5 for ; Fri, 13 Nov 2020 14:24:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D7B122226 for ; Fri, 13 Nov 2020 14:24:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DWxKl2oT"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nExdUbbf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726770AbgKMOYV (ORCPT ); Fri, 13 Nov 2020 09:24:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726731AbgKMOYS (ORCPT ); Fri, 13 Nov 2020 09:24:18 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6F49C0613D1; Fri, 13 Nov 2020 06:24:18 -0800 (PST) Message-Id: <20201113141732.844232404@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=ldQX6LV392Sp6q38lky8DIKaFNB4v1tclruB3q140vY=; b=DWxKl2oTbNiJFq242wyZFcPjhLIfi3MaxEuLNamTK0kgTpXZwoj9qCXalq5cmZeVakyDGb cvWQ7byxNNAmxOd6N/SxAJvBHXxlhNqBclgGsibUj82yLY8MuKQzAAPCHCjAf/qIYHy2D6 W5tsHVECZdJYVjqPxrYP9rLOyReZ2k4MtGlj43h6ccGqhN6bZQ5/IjSB2po7a0CWoD980B iAvURAzqfrzpjhUJg4BBA0zGWTdL77O8rgWb0A1nTMg+XWiIZq71MMP2TqSl2LZoyObVtA VkoPC+VsDJte/Al56vqeV/59r0im2vkOGC5hEHuQhQqiYjuYshTMPE/PIM8NqA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=ldQX6LV392Sp6q38lky8DIKaFNB4v1tclruB3q140vY=; b=nExdUbbfCrGRLLhnMqfpr0nkpzGHfv4w1OWpXggW5hEFnW/+ZTqdLmi9nHPs7YdyQs2O8Z ljzOoqMbS2TkhZCg== Date: Fri, 13 Nov 2020 15:02:09 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 02/19] sh: Get rid of nmi_count() References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org nmi_count() is a historical leftover and SH is the only user. Replace it with regular per cpu accessors. Signed-off-by: Thomas Gleixner Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- arch/sh/kernel/irq.c | 2 +- arch/sh/kernel/traps.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -44,7 +44,7 @@ int arch_show_interrupts(struct seq_file seq_printf(p, "%*s: ", prec, "NMI"); for_each_online_cpu(j) - seq_printf(p, "%10u ", nmi_count(j)); + seq_printf(p, "%10u ", per_cpu(irq_stat.__nmi_count, j); seq_printf(p, " Non-maskable interrupts\n"); seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c @@ -186,7 +186,7 @@ BUILD_TRAP_HANDLER(nmi) arch_ftrace_nmi_enter(); nmi_enter(); - nmi_count(cpu)++; + this_cpu_inc(irq_stat.__nmi_count); switch (notify_die(DIE_NMI, "NMI", regs, 0, vec & 0xff, SIGINT)) { case NOTIFY_OK: From patchwork Fri Nov 13 14:02:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903577 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 51ADF921 for ; Fri, 13 Nov 2020 14:24:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3430D22226 for ; Fri, 13 Nov 2020 14:24:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="N4/KUa4u"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Qj6DBzLc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726755AbgKMOYV (ORCPT ); Fri, 13 Nov 2020 09:24:21 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52408 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbgKMOYU (ORCPT ); Fri, 13 Nov 2020 09:24:20 -0500 Message-Id: <20201113141733.005212732@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=dfL8LhZDRV94dZhXM7BmDFOhpOb0BGKj21oie+vBdLw=; b=N4/KUa4uHiJso+C3WJViL7/en53R4HBsU3ogzm7nvCADvrlv1PVx1WIXj9lmd34MF6Ij/O UvgrjMYr4bv3LIvsyHaCbL6ioUkvdEdsBLPBZB6Ea+mLaljackefDr+F/1JISg+lZycY0I P1QsMCpTre+iuymcShE1lF0uOv9hDxCBZOse0P1gwG5Nts5zzaICKZuFHKcLR20+YBWTwe vViTKdGDQZhL/TQZ6iY90jX1JkBAzVyT8cnzWWceZczuZKdbkV72PvXsq8gELAWXYWjW3K YQ01fiBVVjQFARRJ9zQ0Bs2RhmHWe+rW2I9JA02PbfigdmJ1d/VdAQAx0BDtQA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=dfL8LhZDRV94dZhXM7BmDFOhpOb0BGKj21oie+vBdLw=; b=Qj6DBzLcsREA7P1E6iB6NGDnQ44hCFII2Hz0w+ihai78OgVfJgByLiJi8lZgBMeRRl0hg2 TDFqllYwBkd7sQDw== Date: Fri, 13 Nov 2020 15:02:10 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 03/19] irqstat: Get rid of nmi_count() and __IRQ_STAT() References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Nothing uses this anymore. Signed-off-by: Thomas Gleixner --- include/linux/irq_cpustat.h | 4 ---- 1 file changed, 4 deletions(-) --- a/include/linux/irq_cpustat.h +++ b/include/linux/irq_cpustat.h @@ -19,10 +19,6 @@ #ifndef __ARCH_IRQ_STAT DECLARE_PER_CPU_ALIGNED(irq_cpustat_t, irq_stat); /* defined in asm/hardirq.h */ -#define __IRQ_STAT(cpu, member) (per_cpu(irq_stat.member, cpu)) #endif -/* arch dependent irq_stat fields */ -#define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386 */ - #endif /* __irq_cpustat_h */ From patchwork Fri Nov 13 14:02:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903643 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 6CC08138B for ; Fri, 13 Nov 2020 14:25:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5158F22226 for ; Fri, 13 Nov 2020 14:25:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="O0Gw/PBR"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xm6caWsh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726520AbgKMOZ1 (ORCPT ); Fri, 13 Nov 2020 09:25:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbgKMOYV (ORCPT ); Fri, 13 Nov 2020 09:24:21 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2379C0613D1; Fri, 13 Nov 2020 06:24:20 -0800 (PST) Message-Id: <20201113141733.156361337@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=r+KsoatkzEvFJZ6Uvemw+0bRBnybVbuAAET/CM5K9Pk=; b=O0Gw/PBRfyV5eSjQcVbv7jg+mEj3vPu+omjz2/4gumbSqYTwbod9fjfxDBec4KD3ldbfj1 PKTwzSBW+XPJ5yA4AToMdseNerHoIbd6/J6Ak2g0AJSySvu1E1qwcXempGYdbHR3E9L8m6 HUkEVjg30iV6HuEAWXHO5t5JWELG7hR7rYG86QhVorHRWkTx3bfNZ1QZCbNLkbHGThTj9h Gmy1CtUgQRty4mQJxzs5u4m4E890g/7qSRuvoEBxpoozS8r8bgiVGBYkFzTvoHfi2Ge2xV wl4VyGJTXnKlI48Yyl9nD27SGp7lD50AAUO7KCpatdJr9vU0agxVjcJ6SLopZA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=r+KsoatkzEvFJZ6Uvemw+0bRBnybVbuAAET/CM5K9Pk=; b=xm6caWshtGnMX9Pmj2feIgupPTX3uOPlK73ZAKK12FC5HYr0Iu+WtgRZY/vqPeNKeXFDjU JzBZ9C0kLyStR8Bw== Date: Fri, 13 Nov 2020 15:02:11 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 04/19] um/irqstat: Get rid of the duplicated declarations References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org irq_cpustat_t and ack_bad_irq() are exactly the same as the asm-generic ones. Signed-off-by: Thomas Gleixner Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: linux-um@lists.infradead.org --- arch/um/include/asm/hardirq.h | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) --- a/arch/um/include/asm/hardirq.h +++ b/arch/um/include/asm/hardirq.h @@ -2,22 +2,7 @@ #ifndef __ASM_UM_HARDIRQ_H #define __ASM_UM_HARDIRQ_H -#include -#include - -typedef struct { - unsigned int __softirq_pending; -} ____cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ -#include - -#ifndef ack_bad_irq -static inline void ack_bad_irq(unsigned int irq) -{ - printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq); -} -#endif +#include #define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 From patchwork Fri Nov 13 14:02:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903635 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 962D01391 for ; Fri, 13 Nov 2020 14:25:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7976A22226 for ; Fri, 13 Nov 2020 14:25:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cSGo9Tj3"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="noONE0IN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726815AbgKMOYY (ORCPT ); Fri, 13 Nov 2020 09:24:24 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52408 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbgKMOYW (ORCPT ); Fri, 13 Nov 2020 09:24:22 -0500 Message-Id: <20201113141733.276505871@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=LTgrOO5Fq9FzIj5LSBGHqN8dEDpi/W15DA3S3hhXg70=; b=cSGo9Tj3VjO3e4v7/dAH4IZZ25PwX3n0as7D8hV6VwZCQNPp1S/12d3Kuq14YP2Q+vyrH8 jJ/wX30Nie2wEr/7EzpBjuF3iQ1GzsFOZEuMiW2uttAjvlghPcqlVwST2tjAzHciJ3rLq2 7uMKgBEOH2VHJqnsUsfRZ0RZTXOPOxBG+ztScXR/kk53gqcz+APJbPKljJlmOTBDu0qFSd geRk0h1rhyNhLZUWadkKhKDlm2LK9xR6e6jqW+rtDsZmAZ0P4di9X83bBTcSkBrFBjeZOz jTvXn+8jksC0VgwFXsC/4El8Vh0d+LxM/viS14PxPZXkBWuZlPiBQb7W9OznGg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=LTgrOO5Fq9FzIj5LSBGHqN8dEDpi/W15DA3S3hhXg70=; b=noONE0INwvcUkNhZIQyhLfhz07DlUVIlJ0h9nTo2GLLZIKCJd/IkkvvJH09DJ6hENwmy+q rE/SZK+1OHpuQlDw== Date: Fri, 13 Nov 2020 15:02:12 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 05/19] ARM: irqstat: Get rid of duplicated declaration References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org irq_cpustat_t is exactly the same as the asm-generic one. Define ack_bad_irq so the generic header does not emit the generic version of it. Signed-off-by: Thomas Gleixner Cc: Russell King Cc: Marc Zyngier Cc: Valentin Schneider Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Valentin Schneider --- arch/arm/include/asm/hardirq.h | 11 +++-------- arch/arm/include/asm/irq.h | 2 ++ 2 files changed, 5 insertions(+), 8 deletions(-) --- a/arch/arm/include/asm/hardirq.h +++ b/arch/arm/include/asm/hardirq.h @@ -2,16 +2,11 @@ #ifndef __ASM_HARDIRQ_H #define __ASM_HARDIRQ_H -#include -#include #include -typedef struct { - unsigned int __softirq_pending; -} ____cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ - #define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 +#define ack_bad_irq ack_bad_irq + +#include #endif /* __ASM_HARDIRQ_H */ --- a/arch/arm/include/asm/irq.h +++ b/arch/arm/include/asm/irq.h @@ -31,6 +31,8 @@ void handle_IRQ(unsigned int, struct pt_ void init_IRQ(void); #ifdef CONFIG_SMP +#include + extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self); #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace From patchwork Fri Nov 13 14:02:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903637 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 C8506921 for ; Fri, 13 Nov 2020 14:25:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A38AD22240 for ; Fri, 13 Nov 2020 14:25:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lEDXukR0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8EcLL2Mj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgKMOZV (ORCPT ); Fri, 13 Nov 2020 09:25:21 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52496 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbgKMOYY (ORCPT ); Fri, 13 Nov 2020 09:24:24 -0500 Message-Id: <20201113141733.392015387@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=TyQaO1KTOnQylNyXqxWcHMMYAxiiSJ2Q6FuIeS+IiF4=; b=lEDXukR0oK89SaoPklU/SlvTO4AL3FW7GtfHdqKagFFJBz68+N8DGdCe/0EEWypICcBgfZ wSwEA6mdjl0V8HHeF09kj/7r5ookPrS4PPP/mFt7wBY+msVoxO8OIaRotonDWQPXXat5ot UwXzLRGrG+BjHy9sq1LL5SuGdK2ZwyH6oYS17dxfNKVv40lxmUF0I/zMgsJTI2beJJ6Thk 3bgYhE2ykrFnPGkhew+FXzp5SoptOYITranaNsMPwVkAXjBXG1OVfC4kPgOyOQR0j4GYYz 83OwnIjUaKOVlixefPLnQ38+4y8XAZhRP+5bBagZC3NLAENT7q6vhSsVBtwIwA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=TyQaO1KTOnQylNyXqxWcHMMYAxiiSJ2Q6FuIeS+IiF4=; b=8EcLL2MjKtWP9jXkLNSdACpvbZt324DYTS3ZV5jkNvp419QrSxtZ6sgw1e9rErz090S0+8 MNDYn4yqeq+V2VCA== Date: Fri, 13 Nov 2020 15:02:13 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , Catalin Marinas , Will Deacon , Marc Zyngier , linux-arm-kernel@lists.infradead.org, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Valentin Schneider Subject: [patch 06/19] arm64: irqstat: Get rid of duplicated declaration References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org irq_cpustat_t is exactly the same as the asm-generic one. Define ack_bad_irq so the generic header does not emit the generic version of it. Signed-off-by: Thomas Gleixner Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org Acked-by: Will Deacon Acked-by: Marc Zyngier --- arch/arm64/include/asm/hardirq.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/arch/arm64/include/asm/hardirq.h +++ b/arch/arm64/include/asm/hardirq.h @@ -13,11 +13,8 @@ #include #include -typedef struct { - unsigned int __softirq_pending; -} ____cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ +#define ack_bad_irq ack_bad_irq +#include #define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 From patchwork Fri Nov 13 14:02:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903581 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 A34E8138B for ; Fri, 13 Nov 2020 14:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86D8F22258 for ; Fri, 13 Nov 2020 14:24:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="U1TO39nO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="un8PSw38" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726827AbgKMOYZ (ORCPT ); Fri, 13 Nov 2020 09:24:25 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52544 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726731AbgKMOYZ (ORCPT ); Fri, 13 Nov 2020 09:24:25 -0500 Message-Id: <20201113141733.501611990@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=OHBT/GvIcx8sVKLm+I9A4wHeNhC5PYlDa+OcCnGbESo=; b=U1TO39nOFoVbk93TwLqtmx7eirvEZHX/LsbXoG8kX8NYI9La4G+iYW3KsdHywpTurZ21jE lcKQVyEXjPaHxz3lSGJORdX0PV4/sTuPicpK53k1W2sARNdyynyNxlK04wAOdXNtq2Y+1I kyXeIknJBqtGPO0mtTckQdR6o/1fHSJzBO7XiCN5CwzRlIea3+p6Z888Nq7lq2nzxJewYo FBDQ/0oalzSY9f6mcTHDO8LMM+TNDOAqrhVtE/ljspI/osFPT/oFpJxPDXcxEnAtj1IgFU qFZzF+5Bvq53Hh55iyMItfff0W0EZlIbcRP2pxMeFBFeamngsGfkzvqthPnUbA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=OHBT/GvIcx8sVKLm+I9A4wHeNhC5PYlDa+OcCnGbESo=; b=un8PSw38kc67x10IKXSJioXWUKjQjWWlL39xWy2VdmA0v1fdujzmkwrpWq2pk6cDYFi2rd 8SpDL5kN3gfHhbCA== Date: Fri, 13 Nov 2020 15:02:14 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 07/19] asm-generic/irqstat: Add optional __nmi_count member References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Add an optional __nmi_count member to irq_cpustat_t so more architectures can use the generic version. Signed-off-by: Thomas Gleixner --- include/asm-generic/hardirq.h | 3 +++ 1 file changed, 3 insertions(+) --- a/include/asm-generic/hardirq.h +++ b/include/asm-generic/hardirq.h @@ -7,6 +7,9 @@ typedef struct { unsigned int __softirq_pending; +#ifdef ARCH_WANTS_NMI_IRQSTAT + unsigned int __nmi_count; +#endif } ____cacheline_aligned irq_cpustat_t; #include /* Standard mappings for irq_cpustat_t above */ From patchwork Fri Nov 13 14:02:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903629 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 096CD138B for ; Fri, 13 Nov 2020 14:25:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE99322242 for ; Fri, 13 Nov 2020 14:25:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="X0A7oXXL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IfoJhzBO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726860AbgKMOZQ (ORCPT ); Fri, 13 Nov 2020 09:25:16 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52408 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726808AbgKMOY0 (ORCPT ); Fri, 13 Nov 2020 09:24:26 -0500 Message-Id: <20201113141733.625146223@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=j4YFkLEVJW9mHHVjXYizVQN08g6GeJTUUb5qDNcMGts=; b=X0A7oXXLl77tzShFHyL2be6dGuH2n0ajai/5PNHmXMm2Nduo9l3C78d2rRfs8um7hiajwz LLHAaVgSEsf6QYSzwSiDzq7rbw2QitpZ/aAANOMbAqrig6bybRybNZB2muYuDrXv5T0Hog aHx9kd4TQ2jtGQ+JxY6sbWUbsBVwCq+pV/QRiq3z6aaCJCLE9A1b9C5fsm24FrH0YwrudH abLQf3y2N1gR3t9uvLayu0DU2BCqPqAeUlywRucg5A6Eb8qDHpfmNIYKW7ulE/xc0pSBjS U0YyqBRBrS8x2r8DBsXej93yuZ/6flBjmjqANnRgpcLYv59gobr0sTeVHTdWZA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=j4YFkLEVJW9mHHVjXYizVQN08g6GeJTUUb5qDNcMGts=; b=IfoJhzBOzwM0Ah30l/7drK6GoTjrrURxvcwYoU7580CtlGXgaQQtBYwJYv96kjOc5mH649 PlRaWsaQfp6lUCDg== Date: Fri, 13 Nov 2020 15:02:15 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 08/19] sh: irqstat: Use the generic irq_cpustat_t References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org SH can now use the generic irq_cpustat_t. Define ack_bad_irq so the generic header does not emit the generic version of it. Signed-off-by: Thomas Gleixner Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- arch/sh/include/asm/hardirq.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) --- a/arch/sh/include/asm/hardirq.h +++ b/arch/sh/include/asm/hardirq.h @@ -2,16 +2,10 @@ #ifndef __ASM_SH_HARDIRQ_H #define __ASM_SH_HARDIRQ_H -#include -#include - -typedef struct { - unsigned int __softirq_pending; - unsigned int __nmi_count; /* arch dependent */ -} ____cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ - extern void ack_bad_irq(unsigned int irq); +#define ack_bad_irq ack_bad_irq +#define ARCH_WANTS_NMI_IRQSTAT + +#include #endif /* __ASM_SH_HARDIRQ_H */ From patchwork Fri Nov 13 14:02:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903625 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 CB9DF138B for ; Fri, 13 Nov 2020 14:25:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B069222226 for ; Fri, 13 Nov 2020 14:25:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="oKGHrc6n"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IPeONiRz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbgKMOY2 (ORCPT ); Fri, 13 Nov 2020 09:24:28 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52496 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726830AbgKMOY1 (ORCPT ); Fri, 13 Nov 2020 09:24:27 -0500 Message-Id: <20201113141733.737377332@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=S06QIqfNWoqS9gVbzzc2YmE/3ZeyYSj3ENqKW66z6Fk=; b=oKGHrc6ngr7pniRBz0GCkmv8BaYBF1FeplvyjX2vJwsAUgrYdz4cnmB3wC6mJfdcpJ40/H ux+ye5dfkWJDyog2W1IQX301wYzlzg7uWVTZrs75VYHHBnURdhLltHVQmJsjpqa9J9Hqgr RvCdcuEChzRjZQ8L7ZVwtW5/vwPvKRX3p4g3WHLxCUiZgLizT+s06zATCfIPpMAgpHOek2 blevGecPsXV46jkSksH8VB2aY8+xrd0r+z1CmOkz77H4397toGWI/IsDpiSW1Qb0CCsW1q vz+nLMNGXJ53AFfra+OdwJruy0uePrpJBb5PcFI3scSV7vN2wUJUtoHsTtiJVg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=S06QIqfNWoqS9gVbzzc2YmE/3ZeyYSj3ENqKW66z6Fk=; b=IPeONiRzhIvWN0gM+Ny+HdS5Bcn9NO+HpkoDUkh8pXwqmmyh85sM7Nl+LVtoPIFtKmYPWZ LACjWnVzSBcd/0BA== Date: Fri, 13 Nov 2020 15:02:16 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 09/19] irqstat: Move declaration into asm-generic/hardirq.h References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Move the declaration of the irq_cpustat per cpu variable to asm-generic/hardirq.h and remove the now empty linux/irq_cpustat.h header. Signed-off-by: Thomas Gleixner --- include/asm-generic/hardirq.h | 3 ++- include/linux/irq_cpustat.h | 24 ------------------------ 2 files changed, 2 insertions(+), 25 deletions(-) --- a/include/asm-generic/hardirq.h +++ b/include/asm-generic/hardirq.h @@ -12,7 +12,8 @@ typedef struct { #endif } ____cacheline_aligned irq_cpustat_t; -#include /* Standard mappings for irq_cpustat_t above */ +DECLARE_PER_CPU_ALIGNED(irq_cpustat_t, irq_stat); + #include #ifndef ack_bad_irq --- a/include/linux/irq_cpustat.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __irq_cpustat_h -#define __irq_cpustat_h - -/* - * Contains default mappings for irq_cpustat_t, used by almost every - * architecture. Some arch (like s390) have per cpu hardware pages and - * they define their own mappings for irq_stat. - * - * Keith Owens July 2000. - */ - - -/* - * Simple wrappers reducing source bloat. Define all irq_stat fields - * here, even ones that are arch dependent. That way we get common - * definitions instead of differing sets for each arch. - */ - -#ifndef __ARCH_IRQ_STAT -DECLARE_PER_CPU_ALIGNED(irq_cpustat_t, irq_stat); /* defined in asm/hardirq.h */ -#endif - -#endif /* __irq_cpustat_h */ From patchwork Fri Nov 13 14:02:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903609 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 066BC921 for ; Fri, 13 Nov 2020 14:25:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC75E22226 for ; Fri, 13 Nov 2020 14:25:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="MgbURSwO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="U31sNj/t" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726871AbgKMOYa (ORCPT ); Fri, 13 Nov 2020 09:24:30 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52544 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbgKMOY2 (ORCPT ); Fri, 13 Nov 2020 09:24:28 -0500 Message-Id: <20201113141733.864469886@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=nizsG88oO/X3MAUujrJwkAWDoWXjRvd/hu62TCrMv00=; b=MgbURSwOdt2u2AfAXuvt5e3xI+wad7mH9+9w+LH8RtRgcvyiuie/7z3Ircx4qNNKtyXNxN n/qTUFL91x5E4rqamZQEE6AwvSWsBlClV89x7y5/02KhBULAPFYoxOqqgJaeAUoAuY9OV2 ILnN2zBb5V4sCj91YMROOwHtddlh/gcxyp6g5IUS0Im7gU79gdvprs3rL8QhGARB/G64ot qMr1gQ9jLMyp2aUmt1nAAHReLBbqwKkiOjB1kJ3i5n/+bMDBAJFy4DazZM9tpYBsn72mMC 5pIZSXRya7s/NB9Rmvl2uZ4Ga6Vrl3ooi24lEOubx3YblZfMP84/7fqdt+6VCw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=nizsG88oO/X3MAUujrJwkAWDoWXjRvd/hu62TCrMv00=; b=U31sNj/t2lOnt0NAoJOjrAxdod3h1s384ukHOPLY/KJc+CvGOTBvXvkWlC460hGxUiLJaZ vD3C6rVE+MxoNCDQ== Date: Fri, 13 Nov 2020 15:02:17 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 10/19] preempt: Cleanup the macro maze a bit References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Make the macro maze consistent and prepare it for adding the RT variant for BH accounting. - Use nmi_count() for the NMI portion of preempt count - Introduce in_hardirq() to make the naming consistent and non-ambiguos - Use the macros to create combined checks (e.g. in_task()) so the softirq representation for RT just falls into place. - Update comments and move the deprecated macros aside Signed-off-by: Thomas Gleixner --- include/linux/preempt.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -77,31 +77,33 @@ /* preempt_count() and related functions, depends on PREEMPT_NEED_RESCHED */ #include +#define nmi_count() (preempt_count() & NMI_MASK) #define hardirq_count() (preempt_count() & HARDIRQ_MASK) #define softirq_count() (preempt_count() & SOFTIRQ_MASK) -#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \ - | NMI_MASK)) +#define irq_count() (nmi_count() | hardirq_count() | softirq_count()) /* - * Are we doing bottom half or hardware interrupt processing? + * Macros to retrieve the current execution context: * - * in_irq() - We're in (hard) IRQ context + * in_nmi() - We're in NMI context + * in_hardirq() - We're in hard IRQ context + * in_serving_softirq() - We're in softirq context + * in_task() - We're in task context + */ +#define in_nmi() (nmi_count()) +#define in_hardirq() (hardirq_count()) +#define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET) +#define in_task() (!(in_nmi() | in_hardirq() | in_serving_softirq())) + +/* + * The following macros are deprecated and should not be used in new code: + * in_irq() - Obsolete version of in_hardirq() * in_softirq() - We have BH disabled, or are processing softirqs * in_interrupt() - We're in NMI,IRQ,SoftIRQ context or have BH disabled - * in_serving_softirq() - We're in softirq context - * in_nmi() - We're in NMI context - * in_task() - We're in task context - * - * Note: due to the BH disabled confusion: in_softirq(),in_interrupt() really - * should not be used in new code. */ #define in_irq() (hardirq_count()) #define in_softirq() (softirq_count()) #define in_interrupt() (irq_count()) -#define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET) -#define in_nmi() (preempt_count() & NMI_MASK) -#define in_task() (!(preempt_count() & \ - (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET))) /* * The preempt_count offset after preempt_disable(); From patchwork Fri Nov 13 14:02:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903617 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 A804C1391 for ; Fri, 13 Nov 2020 14:25:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8764D22226 for ; Fri, 13 Nov 2020 14:25:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jv2EEflp"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9fpm5+mi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727001AbgKMOZD (ORCPT ); Fri, 13 Nov 2020 09:25:03 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52496 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726860AbgKMOYa (ORCPT ); Fri, 13 Nov 2020 09:24:30 -0500 Message-Id: <20201113141733.974214480@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=0UTeqwKc93bYeYTKZ9eNkJ81wNDHGHkvSAl8j8+Yj5Q=; b=jv2EEflphEE3CebcE72q1RNivrgP3cY6CABEy6b2ZgZLZDSvbL+oeMi5wEZugM4xGCuqu7 iA1kifAro0LVNSxg7SiHdTE4/VJI8sHguJCBvTJoX3AfamxiI8P7XO1BHBKk/yTWSS/Lhn SwwaIxFQ2VxUKsJMvA4DG6XeplBDsVoiQFOT/ceQWIaU/pKJr7zagt96VnJrFHNQxNvihF kAEReD5i/Fx180ZHUtX/TWNbSqTV/8OF/HEfMjOnDHgs4pz85Q5Rg1CD63euT6nGQbFfsi EN8ORThOKeZm4WBytizPIltx9HExbUBbfnT3JCYNTd8gjAileLVA9vl7kainFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=0UTeqwKc93bYeYTKZ9eNkJ81wNDHGHkvSAl8j8+Yj5Q=; b=9fpm5+miuJxrT+jze0aGitkbirAatyttDigNLtfzZs+AU5LOUy0Evsyi9vnWdaCR1KDuYI Vmu6Q7I4ArxJjlBQ== Date: Fri, 13 Nov 2020 15:02:18 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 11/19] softirq: Move related code into one section References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org To prepare for adding a RT aware variant of softirq serialization and processing move related code into one section so the necessary #ifdeffery is reduced to one. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker --- kernel/softirq.c | 107 +++++++++++++++++++++++++++---------------------------- 1 file changed, 54 insertions(+), 53 deletions(-) --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -92,6 +92,13 @@ static bool ksoftirqd_running(unsigned l !__kthread_should_park(tsk); } +#ifdef CONFIG_TRACE_IRQFLAGS +DEFINE_PER_CPU(int, hardirqs_enabled); +DEFINE_PER_CPU(int, hardirq_context); +EXPORT_PER_CPU_SYMBOL_GPL(hardirqs_enabled); +EXPORT_PER_CPU_SYMBOL_GPL(hardirq_context); +#endif + /* * preempt_count and SOFTIRQ_OFFSET usage: * - preempt_count is changed by SOFTIRQ_OFFSET on entering or leaving @@ -102,17 +109,11 @@ static bool ksoftirqd_running(unsigned l * softirq and whether we just have bh disabled. */ +#ifdef CONFIG_TRACE_IRQFLAGS /* - * This one is for softirq.c-internal use, - * where hardirqs are disabled legitimately: + * This is for softirq.c-internal use, where hardirqs are disabled + * legitimately: */ -#ifdef CONFIG_TRACE_IRQFLAGS - -DEFINE_PER_CPU(int, hardirqs_enabled); -DEFINE_PER_CPU(int, hardirq_context); -EXPORT_PER_CPU_SYMBOL_GPL(hardirqs_enabled); -EXPORT_PER_CPU_SYMBOL_GPL(hardirq_context); - void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) { unsigned long flags; @@ -203,6 +204,50 @@ void __local_bh_enable_ip(unsigned long } EXPORT_SYMBOL(__local_bh_enable_ip); +static inline void invoke_softirq(void) +{ + if (ksoftirqd_running(local_softirq_pending())) + return; + + if (!force_irqthreads) { +#ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK + /* + * We can safely execute softirq on the current stack if + * it is the irq stack, because it should be near empty + * at this stage. + */ + __do_softirq(); +#else + /* + * Otherwise, irq_exit() is called on the task stack that can + * be potentially deep already. So call softirq in its own stack + * to prevent from any overrun. + */ + do_softirq_own_stack(); +#endif + } else { + wakeup_softirqd(); + } +} + +asmlinkage __visible void do_softirq(void) +{ + __u32 pending; + unsigned long flags; + + if (in_interrupt()) + return; + + local_irq_save(flags); + + pending = local_softirq_pending(); + + if (pending && !ksoftirqd_running(pending)) + do_softirq_own_stack(); + + local_irq_restore(flags); +} + /* * We restart softirq processing for at most MAX_SOFTIRQ_RESTART times, * but break the loop if need_resched() is set or after 2 ms. @@ -327,24 +372,6 @@ asmlinkage __visible void __softirq_entr current_restore_flags(old_flags, PF_MEMALLOC); } -asmlinkage __visible void do_softirq(void) -{ - __u32 pending; - unsigned long flags; - - if (in_interrupt()) - return; - - local_irq_save(flags); - - pending = local_softirq_pending(); - - if (pending && !ksoftirqd_running(pending)) - do_softirq_own_stack(); - - local_irq_restore(flags); -} - /** * irq_enter_rcu - Enter an interrupt context with RCU watching */ @@ -371,32 +398,6 @@ void irq_enter(void) irq_enter_rcu(); } -static inline void invoke_softirq(void) -{ - if (ksoftirqd_running(local_softirq_pending())) - return; - - if (!force_irqthreads) { -#ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK - /* - * We can safely execute softirq on the current stack if - * it is the irq stack, because it should be near empty - * at this stage. - */ - __do_softirq(); -#else - /* - * Otherwise, irq_exit() is called on the task stack that can - * be potentially deep already. So call softirq in its own stack - * to prevent from any overrun. - */ - do_softirq_own_stack(); -#endif - } else { - wakeup_softirqd(); - } -} - static inline void tick_irq_exit(void) { #ifdef CONFIG_NO_HZ_COMMON From patchwork Fri Nov 13 14:02:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903619 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 CF933921 for ; Fri, 13 Nov 2020 14:25:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B671422226 for ; Fri, 13 Nov 2020 14:25:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hWAB3oHV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kNX4csPH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbgKMOZC (ORCPT ); Fri, 13 Nov 2020 09:25:02 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52700 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726830AbgKMOYb (ORCPT ); Fri, 13 Nov 2020 09:24:31 -0500 Message-Id: <20201113141734.096224353@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=7FMqhKuhnVJot7gugFY0sIHhr7C/a6J/+QfyYVD8emw=; b=hWAB3oHVAGiodkIZKWVA/wHw+8lM5Yf9xpgH9yZCucVDL3PA3DKYbCR3kxRj/aEeniifps SvXIhCS5yN18DxJrcFdOTteQ2XNq1ZARAhc5AarZf3NcZ0kofmD9ndFAw0sUyGz1vOgi3M oMVOOhtMW5aIGAqGQR59uudOHtzseVzzr9CoU+VBu4W8O1apSYzc8GzsrimvBjLt3Wohq1 i6D2Tz8z7RzK1Pc1+GcoMLAr9Hxps0/mCwXgE3NWa3ScwqRpsrCTHaSPntIYLa/typVLWO VfSUZ51CyDHAhDEau2h/yeF2NcU4eMjCmTAFJ/HouWZlfSRj9nF7INS1SDWjrw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=7FMqhKuhnVJot7gugFY0sIHhr7C/a6J/+QfyYVD8emw=; b=kNX4csPHdXBz2VCKmQeCbwIwI3e4E8fGLYskNFO77kKPXf4ZoefJQdRB+pZU7ZYJcXn8Hq Dfon13Yv89lSSnDQ== Date: Fri, 13 Nov 2020 15:02:19 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 12/19] softirq: Add RT specific softirq accounting References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org RT requires the softirq to be preemptible and uses a per CPU local lock to protect BH disabled sections and softirq processing. Therefore RT cannot use the preempt counter to keep track of BH disabled/serving. Add a RT only counter to task struct and adjust the relevant macros in preempt.h. Signed-off-by: Thomas Gleixner --- include/linux/hardirq.h | 1 + include/linux/preempt.h | 6 +++++- include/linux/sched.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -79,7 +79,11 @@ #define nmi_count() (preempt_count() & NMI_MASK) #define hardirq_count() (preempt_count() & HARDIRQ_MASK) -#define softirq_count() (preempt_count() & SOFTIRQ_MASK) +#ifdef CONFIG_PREEMPT_RT +# define softirq_count() (current->softirq_disable_cnt & SOFTIRQ_MASK) +#else +# define softirq_count() (preempt_count() & SOFTIRQ_MASK) +#endif #define irq_count() (nmi_count() | hardirq_count() | softirq_count()) /* --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1004,6 +1004,9 @@ struct task_struct { int softirq_context; int irq_config; #endif +#ifdef CONFIG_PREEMPT_RT + int softirq_disable_cnt; +#endif #ifdef CONFIG_LOCKDEP # define MAX_LOCK_DEPTH 48UL From patchwork Fri Nov 13 14:02:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903621 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 23E1017D5 for ; Fri, 13 Nov 2020 14:25:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08D8522240 for ; Fri, 13 Nov 2020 14:25:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="URSw8F8q"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Fz21tLWb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727019AbgKMOZC (ORCPT ); Fri, 13 Nov 2020 09:25:02 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52544 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726876AbgKMOYb (ORCPT ); Fri, 13 Nov 2020 09:24:31 -0500 Message-Id: <20201113141734.207605126@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=hOeV4Uk7rTRj8OzrhfpKRZ7P0pi7lfMrsyiB2KyVEto=; b=URSw8F8qCzxPeiiiqFqLJq9vgbvQvNB5bDnNWfPE+JIpuybZnnqa6IY2ofJgdJEzeECG1k nhxbzeTOcEEvoxg1p1gpTnBtwmuhcli6AM1SNnRvxqaWxfgHNpCparobE9ZTa6h2KAAa+v MBrwhlBSGWEvD5ZpHidwQC8lXS2eus6R0/70ep00jQRw4a9jRrgh1//4WmUXUh58ZUnCFL xPUZYjZdaJI+U0Hp3OvS3r/2BITHOzsrQgk94F3mhIhmRjdcJz/nKaMQBzJN4VqrZeDiF+ dQnYFmwrcpE8ZJZTEriBYAiF9Sk4DG/6XxukcDyuOXKxIX9aB5EE6QSD48kitQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=hOeV4Uk7rTRj8OzrhfpKRZ7P0pi7lfMrsyiB2KyVEto=; b=Fz21tLWb3UVdRRr7AeS4qYH3y/k/kNtsttrdQl7tgpxPBCYlIGzhDVQ+drwgixYSrTaLVV n5yXU+FH5qMvt3Dw== Date: Fri, 13 Nov 2020 15:02:20 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 13/19] softirq: Move various protections into inline helpers References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org To allow reuse of the bulk of softirq processing code for RT and to avoid #ifdeffery all over the place, split protections for various code sections out into inline helpers so the RT variant can just replace them in one go. Signed-off-by: Thomas Gleixner --- kernel/softirq.c | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -204,6 +204,42 @@ void __local_bh_enable_ip(unsigned long } EXPORT_SYMBOL(__local_bh_enable_ip); +static inline void local_bh_disable_irq_enter(void) +{ + local_bh_disable(); +} + +static inline void local_bh_enable_irq_enter(void) +{ + _local_bh_enable(); +} + +static inline void softirq_handle_begin(void) +{ + __local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET); +} + +static inline void softirq_handle_end(void) +{ + __local_bh_enable(SOFTIRQ_OFFSET); + WARN_ON_ONCE(in_interrupt()); +} + +static inline void ksoftirqd_run_begin(void) +{ + local_irq_disable(); +} + +static inline void ksoftirqd_run_end(void) +{ + local_irq_enable(); +} + +static inline bool should_wake_ksoftirqd(void) +{ + return true; +} + static inline void invoke_softirq(void) { if (ksoftirqd_running(local_softirq_pending())) @@ -317,7 +353,7 @@ asmlinkage __visible void __softirq_entr pending = local_softirq_pending(); account_irq_enter_time(current); - __local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET); + softirq_handle_begin(); in_hardirq = lockdep_softirq_start(); restart: @@ -367,8 +403,7 @@ asmlinkage __visible void __softirq_entr lockdep_softirq_end(in_hardirq); account_irq_exit_time(current); - __local_bh_enable(SOFTIRQ_OFFSET); - WARN_ON_ONCE(in_interrupt()); + softirq_handle_end(); current_restore_flags(old_flags, PF_MEMALLOC); } @@ -382,9 +417,9 @@ void irq_enter_rcu(void) * Prevent raise_softirq from needlessly waking up ksoftirqd * here, as softirq will be serviced on return from interrupt. */ - local_bh_disable(); + local_bh_disable_irq_enter(); tick_irq_enter(); - _local_bh_enable(); + local_bh_enable_irq_enter(); } __irq_enter(); } @@ -467,7 +502,7 @@ inline void raise_softirq_irqoff(unsigne * Otherwise we wake up ksoftirqd to make sure we * schedule the softirq soon. */ - if (!in_interrupt()) + if (!in_interrupt() && should_wake_ksoftirqd()) wakeup_softirqd(); } @@ -645,18 +680,18 @@ static int ksoftirqd_should_run(unsigned static void run_ksoftirqd(unsigned int cpu) { - local_irq_disable(); + ksoftirqd_run_begin(); if (local_softirq_pending()) { /* * We can safely run softirq on inline stack, as we are not deep * in the task stack here. */ __do_softirq(); - local_irq_enable(); + ksoftirqd_run_end(); cond_resched(); return; } - local_irq_enable(); + ksoftirqd_run_end(); } #ifdef CONFIG_HOTPLUG_CPU From patchwork Fri Nov 13 14:02:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903603 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 8FB461746 for ; Fri, 13 Nov 2020 14:24:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6817822226 for ; Fri, 13 Nov 2020 14:24:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="x1p32VGa"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wt0M/xoG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726900AbgKMOYe (ORCPT ); Fri, 13 Nov 2020 09:24:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbgKMOYd (ORCPT ); Fri, 13 Nov 2020 09:24:33 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 074ABC0613D1; Fri, 13 Nov 2020 06:24:33 -0800 (PST) Message-Id: <20201113141734.324061522@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=wbnpc9X7QEbMsC5u05tOEqefGMvFIw2n/Z+aIpkv6qk=; b=x1p32VGaC+/58ztufANyFTCrGu/s7tRBghtopa0J2TNYGtemxE3peXZ4sDmIK8VC8MMjJF bkB4beAsFrnn7g5pNsuDvXrQuLAwQwYQWDBk4v1c4MfgvJloCSuDCjYxDqwDvsyo9uI1eI CfUFTTlRXKoe61D1dT9simW3jukPhaFUjhoohSBJoKuqBHeLyth9IHwbVT4QBBjd7jetJh zy5OkhXZarbq3BzVamRPPU+9TU0QA1XK7mXa66ZrbTXHjWJOhZgpJpiyDWorp5XzsuG0ue D1TSqOLJXpTVDWfhk4inCcRETB9syvdtBeQnTcA7VC8+Z+gPahb0NJIxMOSTLw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=wbnpc9X7QEbMsC5u05tOEqefGMvFIw2n/Z+aIpkv6qk=; b=wt0M/xoGdUy77JWjD8mKtY9ZjC6M/bf8RphSiXlCP0VRh7/f7T9RPTgxefi4EOj9ortPvM ohr2G3OJDKzL3sAA== Date: Fri, 13 Nov 2020 15:02:21 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 14/19] softirq: Make softirq control and processing RT aware References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Provide a local lock based serialization for soft interrupts on RT which allows the local_bh_disabled() sections and servicing soft interrupts to be preemptible. Provide the necessary inline helpers which allow to reuse the bulk of the softirq processing code. Signed-off-by: Thomas Gleixner --- include/linux/bottom_half.h | 2 kernel/softirq.c | 207 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 201 insertions(+), 8 deletions(-) --- a/include/linux/bottom_half.h +++ b/include/linux/bottom_half.h @@ -4,7 +4,7 @@ #include -#ifdef CONFIG_TRACE_IRQFLAGS +#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_TRACE_IRQFLAGS) extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt); #else static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -100,20 +101,208 @@ EXPORT_PER_CPU_SYMBOL_GPL(hardirq_contex #endif /* - * preempt_count and SOFTIRQ_OFFSET usage: - * - preempt_count is changed by SOFTIRQ_OFFSET on entering or leaving - * softirq processing. - * - preempt_count is changed by SOFTIRQ_DISABLE_OFFSET (= 2 * SOFTIRQ_OFFSET) + * SOFTIRQ_OFFSET usage: + * + * On !RT kernels 'count' is the preempt counter, on RT kernels this applies + * to a per CPU counter and to task::softirqs_disabled_cnt. + * + * - count is changed by SOFTIRQ_OFFSET on entering or leaving softirq + * processing. + * + * - count is changed by SOFTIRQ_DISABLE_OFFSET (= 2 * SOFTIRQ_OFFSET) * on local_bh_disable or local_bh_enable. + * * This lets us distinguish between whether we are currently processing * softirq and whether we just have bh disabled. */ +#ifdef CONFIG_PREEMPT_RT -#ifdef CONFIG_TRACE_IRQFLAGS /* - * This is for softirq.c-internal use, where hardirqs are disabled + * RT accounts for BH disabled sections in task::softirqs_disabled_cnt and + * also in per CPU softirq_ctrl::cnt. This is necessary to allow tasks in a + * softirq disabled section to be preempted. + * + * The per task counter is used for softirq_count(), in_softirq() and + * in_serving_softirqs() because these counts are only valid when the task + * holding softirq_ctrl::lock is running. + * + * The per CPU counter prevents pointless wakeups of ksoftirqd in case that + * the task which is in a softirq disabled section is preempted or blocks. + */ +struct softirq_ctrl { + local_lock_t lock; + int cnt; +}; + +static DEFINE_PER_CPU(struct softirq_ctrl, softirq_ctrl) = { + .lock = INIT_LOCAL_LOCK(softirq_ctrl.lock), +}; + +void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) +{ + unsigned long flags; + int newcnt; + + WARN_ON_ONCE(in_hardirq()); + + /* First entry of a task into a BH disabled section? */ + if (!current->softirq_disable_cnt) { + if (preemptible()) { + local_lock(&softirq_ctrl.lock); + rcu_read_lock(); + } else { + DEBUG_LOCKS_WARN_ON(this_cpu_read(softirq_ctrl.cnt)); + } + } + + preempt_disable(); + /* + * Track the per CPU softirq disabled state. On RT this is per CPU + * state to allow preemption of bottom half disabled sections. + */ + newcnt = this_cpu_add_return(softirq_ctrl.cnt, cnt); + /* + * Reflect the result in the task state to prevent recursion on the + * local lock and to make softirq_count() & al work. + */ + current->softirq_disable_cnt = newcnt; + + if (IS_ENABLED(CONFIG_TRACE_IRQFLAGS) && newcnt == cnt) { + raw_local_irq_save(flags); + lockdep_softirqs_off(ip); + raw_local_irq_restore(flags); + } + preempt_enable(); +} +EXPORT_SYMBOL(__local_bh_disable_ip); + +static void __local_bh_enable(unsigned int cnt, bool unlock) +{ + unsigned long flags; + int newcnt; + + DEBUG_LOCKS_WARN_ON(current->softirq_disable_cnt != + this_cpu_read(softirq_ctrl.cnt)); + + preempt_disable(); + if (IS_ENABLED(CONFIG_TRACE_IRQFLAGS) && softirq_count() == cnt) { + raw_local_irq_save(flags); + lockdep_softirqs_on(_RET_IP_); + raw_local_irq_restore(flags); + } + + newcnt = this_cpu_sub_return(softirq_ctrl.cnt, cnt); + current->softirq_disable_cnt = newcnt; + preempt_enable(); + + if (!newcnt && unlock) { + rcu_read_unlock(); + local_unlock(&softirq_ctrl.lock); + } +} + +void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) +{ + bool preempt_on = preemptible(); + unsigned long flags; + u32 pending; + int curcnt; + + WARN_ON_ONCE(in_irq()); + lockdep_assert_irqs_enabled(); + + local_irq_save(flags); + curcnt = this_cpu_read(softirq_ctrl.cnt); + + /* + * If this is not reenabling soft interrupts, no point in trying to + * run pending ones. + */ + if (curcnt != cnt) + goto out; + + pending = local_softirq_pending(); + if (!pending || ksoftirqd_running(pending)) + goto out; + + /* + * If this was called from non preemptible context, wake up the + * softirq daemon. + */ + if (!preempt_on) { + wakeup_softirqd(); + goto out; + } + + /* + * Adjust softirq count to SOFTIRQ_OFFSET which makes + * in_serving_softirq() become true. + */ + cnt = SOFTIRQ_OFFSET; + __local_bh_enable(cnt, false); + __do_softirq(); + +out: + __local_bh_enable(cnt, preempt_on); + local_irq_restore(flags); +} +EXPORT_SYMBOL(__local_bh_enable_ip); + +/* + * Invoked from irq_enter_rcu() to prevent that tick_irq_enter() + * pointlessly wakes the softirq daemon. That's handled in __irq_exit_rcu(). + * None of the above logic in the regular bh_disable/enable functions is + * required here. + */ +static inline void local_bh_disable_irq_enter(void) +{ + this_cpu_add(softirq_ctrl.cnt, SOFTIRQ_DISABLE_OFFSET); +} + +static inline void local_bh_enable_irq_enter(void) +{ + this_cpu_sub(softirq_ctrl.cnt, SOFTIRQ_DISABLE_OFFSET); +} + +/* + * Invoked from ksoftirqd_run() outside of the interrupt disabled section + * to acquire the per CPU local lock for reentrancy protection. + */ +static inline void ksoftirqd_run_begin(void) +{ + __local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET); + local_irq_disable(); +} + +/* Counterpart to ksoftirqd_run_begin() */ +static inline void ksoftirqd_run_end(void) +{ + __local_bh_enable(SOFTIRQ_OFFSET, true); + WARN_ON_ONCE(in_interrupt()); + local_irq_enable(); +} + +static inline void softirq_handle_begin(void) { } +static inline void softirq_handle_end(void) { } + +static inline void invoke_softirq(void) +{ + if (!this_cpu_read(softirq_ctrl.cnt)) + wakeup_softirqd(); +} + +static inline bool should_wake_ksoftirqd(void) +{ + return !this_cpu_read(softirq_ctrl.cnt); +} + +#else /* CONFIG_PREEMPT_RT */ + +/* + * This one is for softirq.c-internal use, where hardirqs are disabled * legitimately: */ +#ifdef CONFIG_TRACE_IRQFLAGS void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) { unsigned long flags; @@ -284,6 +473,8 @@ asmlinkage __visible void do_softirq(voi local_irq_restore(flags); } +#endif /* !CONFIG_PREEMPT_RT */ + /* * We restart softirq processing for at most MAX_SOFTIRQ_RESTART times, * but break the loop if need_resched() is set or after 2 ms. @@ -388,8 +579,10 @@ asmlinkage __visible void __softirq_entr pending >>= softirq_bit; } - if (__this_cpu_read(ksoftirqd) == current) + if (!IS_ENABLED(CONFIG_PREEMPT_RT) && + __this_cpu_read(ksoftirqd) == current) rcu_softirq_qs(); + local_irq_disable(); pending = local_softirq_pending(); From patchwork Fri Nov 13 14:02:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903599 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 011DA1391 for ; Fri, 13 Nov 2020 14:24:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA9F522240 for ; Fri, 13 Nov 2020 14:24:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="G1UREJyG"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Qk1c/61D" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726929AbgKMOYi (ORCPT ); Fri, 13 Nov 2020 09:24:38 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52700 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726894AbgKMOYe (ORCPT ); Fri, 13 Nov 2020 09:24:34 -0500 Message-Id: <20201113141734.442990268@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=Ze6MlncdnmAY8gfHx7Z+rZEVhWAMCevnsPTsGbdb6v0=; b=G1UREJyGcaUjT+N2wtoQyCERcLxyjyMAfw8NfT+wy0zwm0us+pf2Ntglv96NgSHbt9/Yjp qoaQCmQHCEZLSl4tgh2fObbzd5Eg0IzKsZOwRDqSmqku7HiNL3S3LkyTYUFx3yi5dSfTxu MFctcDrCS9gok9I097XT39eWW13m7iPU863iXCxWWkLue2i4sFBBOxeCX2J3FMIX3WJFOU XfnbdSiKjTIyQx4waIuiaRF6W5mUn7JksZs9HbxgKcANUpu5giQHMT3WvlrsVLnuu9ttOJ 05xVo+iYIedu+Z/p/XcxdBOfYtlbWlAMcmQFwZfDQFcdF0rqvP2z6Iy7H5Dc2A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=Ze6MlncdnmAY8gfHx7Z+rZEVhWAMCevnsPTsGbdb6v0=; b=Qk1c/61DOVl3kFFVW+aZ3dXfkp84eaNY2QVxxJLj8d6ltQSfXPHHs0VNAwsQ94XeTMC/Dx 80Ju8vg9dueyHvAQ== Date: Fri, 13 Nov 2020 15:02:22 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 15/19] tick/sched: Prevent false positive softirq pending warnings on RT References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On RT a task which has soft interrupts disabled can block on a lock and schedule out to idle while soft interrupts are pending. This triggers the warning in the NOHZ idle code which complains about going idle with pending soft interrupts. But as the task is blocked soft interrupt processing is temporarily blocked as well which means that such a warning is a false positive. To prevent that check the per CPU state which indicates that a scheduled out task has soft interrupts disabled. Signed-off-by: Thomas Gleixner --- include/linux/bottom_half.h | 6 ++++++ kernel/softirq.c | 15 +++++++++++++++ kernel/time/tick-sched.c | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) --- a/include/linux/bottom_half.h +++ b/include/linux/bottom_half.h @@ -32,4 +32,10 @@ static inline void local_bh_enable(void) __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); } +#ifdef CONFIG_PREEMPT_RT +extern bool local_bh_blocked(void); +#else +static inline bool local_bh_blocked(void) { return false; } +#endif + #endif /* _LINUX_BH_H */ --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -138,6 +138,21 @@ static DEFINE_PER_CPU(struct softirq_ctr .lock = INIT_LOCAL_LOCK(softirq_ctrl.lock), }; +/** + * local_bh_blocked() - Check for idle whether BH processing is blocked + * + * Returns false if the per CPU softirq::cnt is 0 otherwise true. + * + * This is invoked from the idle task to guard against false positive + * softirq pending warnings, which would happen when the task which holds + * softirq_ctrl::lock was the only running task on the CPU and blocks on + * some other lock. + */ +bool local_bh_blocked(void) +{ + return this_cpu_read(softirq_ctrl.cnt) != 0; +} + void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) { unsigned long flags; --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -925,7 +925,7 @@ static bool can_stop_idle_tick(int cpu, if (unlikely(local_softirq_pending())) { static int ratelimit; - if (ratelimit < 10 && + if (ratelimit < 10 && !local_bh_blocked() && (local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK)) { pr_warn("NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #%02x!!!\n", (unsigned int) local_softirq_pending()); From patchwork Fri Nov 13 14:02:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903587 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 DD801921 for ; Fri, 13 Nov 2020 14:24:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1B3422226 for ; Fri, 13 Nov 2020 14:24:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tyt0Qkxw"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fnUwM9/d" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726920AbgKMOYh (ORCPT ); Fri, 13 Nov 2020 09:24:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbgKMOYf (ORCPT ); Fri, 13 Nov 2020 09:24:35 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ABCAC0613D1; Fri, 13 Nov 2020 06:24:35 -0800 (PST) Message-Id: <20201113141734.558782917@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=bJK1LO9o5t1YtWfdpnIDn/r1MfJlfGCVMVDvWJrraew=; b=tyt0QkxwI34Q9lW1JnnsRXtivNBFuy/gK+3Wg6p8oacuKn8YRx4hzKHdlinpDrp/pth55z /BAfQMJ9oWB1Hzij2dQW9TnNIt72zNuUSK2q7Y9sitLs8LbSezy690e41NnW6R8l+bjdLt Dy9N0KzC4rjbiZvWJbppzIRBBCJaXY4iwlr6/VDI4DFLjpd+Wid0zoJ5Q8KMUVs9kyP8bn TkcwawJ0a/VM2kifuvxHRxw/fuqLeI5ylL/tFMj9ii+lhwD4TeYdWFVfkRiSMmUrOKnq5i Dd6AOCs0W4DGmkrLSJyCQlgdlvArt+4ylbScr0BlX4BWaQMR0kH/Ya66obWHBg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=bJK1LO9o5t1YtWfdpnIDn/r1MfJlfGCVMVDvWJrraew=; b=fnUwM9/d5ZyoIg34+qJ50+11yImCVU3JOFQ12wxkKiRXsscC5nDPI2NL/xdAbOB6hy8cm9 lNk1ofd0+ZGBajBA== Date: Fri, 13 Nov 2020 15:02:23 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 16/19] rcu: Prevent false positive softirq warning on RT References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Soft interrupt disabled sections can legitimately be preempted or schedule out when blocking on a lock on RT enabled kernels so the RCU preempt check warning has to be disabled for RT kernels. Signed-off-by: Thomas Gleixner --- include/linux/rcupdate.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -319,7 +319,8 @@ static inline void rcu_preempt_sleep_che #define rcu_sleep_check() \ do { \ rcu_preempt_sleep_check(); \ - RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map), \ + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) \ + RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map), \ "Illegal context switch in RCU-bh read-side critical section"); \ RCU_LOCKDEP_WARN(lock_is_held(&rcu_sched_lock_map), \ "Illegal context switch in RCU-sched read-side critical section"); \ From patchwork Fri Nov 13 14:02:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903605 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 29EDA138B for ; Fri, 13 Nov 2020 14:24:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1056022240 for ; Fri, 13 Nov 2020 14:24:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QExJdAkf"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZH/Vk7tQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726930AbgKMOY6 (ORCPT ); Fri, 13 Nov 2020 09:24:58 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52892 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726915AbgKMOYh (ORCPT ); Fri, 13 Nov 2020 09:24:37 -0500 Message-Id: <20201113141734.660734753@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=74sFpsXIvDvQMapG5Pk7sHOAlnsFK2WUN0Z1OZznnHw=; b=QExJdAkfPvDBwGkQeFoFlNrm4JXX8p/fB5MMB0uuiSdagTfMsaVZdXy9G9GBW/pJGeMMhF v2D/rBvzOwa2UI3CLJLGXLp9JbHgnTpigxMvChKOaxUXPDJjvXKV29RXNoCJIM02ssvFoi fAJSXNYmXPoUeZuLpHQOomjC1BPe/vo61ydVsoo44kvswfSQrHrQmBcsQcqiTK7Ntdx/Py xO9hHJhmudd3p/qulzbc5q7cT/UiquVfGqe3gjkh05B6zglrlDkMWKu7yjfwROgKAs1IpI nuG8KFPBmSSMRxwWYbHo6AVIPTGAZ3rfXubf5JvX0QsRdE7Y3QWJo63Q754Rlw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=74sFpsXIvDvQMapG5Pk7sHOAlnsFK2WUN0Z1OZznnHw=; b=ZH/Vk7tQMxbpxGEvsAm2QgjQRjaIccewrZgX7RMwhumzkvb9r1Yzrpuqulq+HX3l7OQ5+E wyyqEioCc993+MDA== Date: Fri, 13 Nov 2020 15:02:24 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 17/19] softirq: Replace barrier() with cpu_relax() in tasklet_unlock_wait() References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org A barrier() in a tight loop which waits for something to happen on a remote CPU is a pointless exercise. Replace it with cpu_relax() which allows HT siblings to make progress. Signed-off-by: Thomas Gleixner --- include/linux/interrupt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -668,7 +668,8 @@ static inline void tasklet_unlock(struct static inline void tasklet_unlock_wait(struct tasklet_struct *t) { - while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); } + while (test_bit(TASKLET_STATE_RUN, &(t)->state)) + cpu_relax(); } #else #define tasklet_trylock(t) 1 From patchwork Fri Nov 13 14:02:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903591 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 287AB921 for ; Fri, 13 Nov 2020 14:24:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04FA522242 for ; Fri, 13 Nov 2020 14:24:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bibqvpSi"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="r81MeMUb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726945AbgKMOYj (ORCPT ); Fri, 13 Nov 2020 09:24:39 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52700 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbgKMOYi (ORCPT ); Fri, 13 Nov 2020 09:24:38 -0500 Message-Id: <20201113141734.788853107@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=H39LibppQlvIcymGFnJumuF0TnrJv/wQeeJyrMh1wnE=; b=bibqvpSiXbaOS4h7rid9FwsrfZSPl9dqxvvgGgVUV9uMsDpeVlzjuZBL5vmTImnrP8aKgV W75ixYNzPjvGLHB88W8l/PfqJkl2eNqE+AOJfxUdflFalLioQXWlwzFwEOeErkpduUMv2T hDTxcgjpz300WGMDoXe9QVdQolKoXoyQeFZRUG+sc6QOFdLOEug1POHDDMo0Rnw6dn/VhC 3bHFASxxIKjReHu3RkXYKgSweZTTUxfSnAG5kRhGsvHOJpthEpvQH0zTb/i3PIzTTYrKar lGIj6hnPgNEg7qHHgMND18ig/lg3lWYVjZh91/LIpb63t+M6EiR2BKOd8cBqGQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=H39LibppQlvIcymGFnJumuF0TnrJv/wQeeJyrMh1wnE=; b=r81MeMUbNWSbPQgCuPKytMvpffni1swCI25j1iY9kSh6gfm/DKBFJAFvtL/QEa+0xZbfNJ zDN9yQZWdSAL1bAQ== Date: Fri, 13 Nov 2020 15:02:25 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 18/19] tasklets: Use static inlines for stub implementations References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Inlines exist for a reason. Signed-off-by: Thomas Gleixner --- include/linux/interrupt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -672,9 +672,9 @@ static inline void tasklet_unlock_wait(s cpu_relax(); } #else -#define tasklet_trylock(t) 1 -#define tasklet_unlock_wait(t) do { } while (0) -#define tasklet_unlock(t) do { } while (0) +static inline int tasklet_trylock(struct tasklet_struct *t) { return 1; } +static inline void tasklet_unlock(struct tasklet_struct *t) { } +static inline void tasklet_unlock_wait(struct tasklet_struct *t) { } #endif extern void __tasklet_schedule(struct tasklet_struct *t); From patchwork Fri Nov 13 14:02:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11903595 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 4B487921 for ; Fri, 13 Nov 2020 14:24:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30BB722226 for ; Fri, 13 Nov 2020 14:24:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CaNkSgmH"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0cKyj2lL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726973AbgKMOYl (ORCPT ); Fri, 13 Nov 2020 09:24:41 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52960 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726930AbgKMOYk (ORCPT ); Fri, 13 Nov 2020 09:24:40 -0500 Message-Id: <20201113141734.907075915@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605277477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=YBANw5+gKo0StNgfq2DAY2w568FUqe7IjvTxRxyhO0o=; b=CaNkSgmHOT8cChidgcipppyqnkXkMwbX36+aFt96F4A75TGeSz5Zhl+di5OltLmYsPtOcx quLDc5LLj6LblcQBRv5T8U2YTKstywSV4Fnr3VcKozPIF6fRJYoUQ1Olop/0XEo/nvWuKK AaWYWZNs1SHuSgrkR+sSNNUqkK/BZ+Mzqxcz+uw6LWxyeMfi7P4VPTLfGShWD5dSRZcvmV k6G5XKLQZrLBaSh78ZCTGlgHOMm+unqZIPu2euxm/TvxLdSaJIG/Ema0BvWrq4w4cjd3wq /o6/AEK8K3F6hkA6SrcnJ6gUpmrTkYW/8FpCsAN598OKXx8HQHBM1zasSFWkjA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605277477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=YBANw5+gKo0StNgfq2DAY2w568FUqe7IjvTxRxyhO0o=; b=0cKyj2lLbsO8b/2NxbYx+cHBAmiqLRZavh3aPgFuRABbFMMdYZx0eS73Lzn7tmtBZWlqdE UDGBXB070OjHFACQ== Date: Fri, 13 Nov 2020 15:02:26 +0100 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [patch 19/19] tasklets: Prevent kill/unlock_wait deadlock on RT References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org tasklet_kill() and tasklet_unlock_wait() spin and wait for the TASKLET_STATE_SCHED resp. TASKLET_STATE_RUN bit in the tasklet state to be cleared. This works on !RT nicely because the corresponding execution can only happen on a different CPU. On RT softirq processing is preemptible, therefore a task preempting the softirq processing thread can spin forever. Prevent this by invoking local_bh_disable()/enable() inside the loop. In case that the softirq processing thread was preempted by the current task, current will block on the local lock which yields the CPU to the preempted softirq processing thread. If the tasklet is processed on a different CPU then the local_bh_disable()/enable() pair is just a waste of processor cycles. Signed-off-by: Thomas Gleixner --- include/linux/interrupt.h | 8 ++------ kernel/softirq.c | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 7 deletions(-) --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -654,7 +654,7 @@ enum TASKLET_STATE_RUN /* Tasklet is running (SMP only) */ }; -#ifdef CONFIG_SMP +#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) static inline int tasklet_trylock(struct tasklet_struct *t) { return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state); @@ -666,11 +666,7 @@ static inline void tasklet_unlock(struct clear_bit(TASKLET_STATE_RUN, &(t)->state); } -static inline void tasklet_unlock_wait(struct tasklet_struct *t) -{ - while (test_bit(TASKLET_STATE_RUN, &(t)->state)) - cpu_relax(); -} +void tasklet_unlock_wait(struct tasklet_struct *t); #else static inline int tasklet_trylock(struct tasklet_struct *t) { return 1; } static inline void tasklet_unlock(struct tasklet_struct *t) { } --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -851,6 +851,29 @@ void tasklet_init(struct tasklet_struct } EXPORT_SYMBOL(tasklet_init); +#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) + +void tasklet_unlock_wait(struct tasklet_struct *t) +{ + while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { + if (IS_ENABLED(CONFIG_PREEMPT_RT)) { + /* + * Prevent a live lock when current preempted soft + * interrupt processing or prevents ksoftirqd from + * running. If the tasklet runs on a different CPU + * then this has no effect other than doing the BH + * disable/enable dance for nothing. + */ + local_bh_disable(); + local_bh_enable(); + } else { + cpu_relax(); + } + } +} +EXPORT_SYMBOL(tasklet_unlock_wait); +#endif + void tasklet_kill(struct tasklet_struct *t) { if (in_interrupt()) @@ -858,7 +881,20 @@ void tasklet_kill(struct tasklet_struct while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { do { - yield(); + if (IS_ENABLED(CONFIG_PREEMPT_RT)) { + /* + * Prevent a live lock when current + * preempted soft interrupt processing or + * prevents ksoftirqd from running. If the + * tasklet runs on a different CPU then + * this has no effect other than doing the + * BH disable/enable dance for nothing. + */ + local_bh_disable(); + local_bh_enable(); + } else { + yield(); + } } while (test_bit(TASKLET_STATE_SCHED, &t->state)); } tasklet_unlock_wait(t);