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: 11903663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DBA6C4742C for ; Fri, 13 Nov 2020 14:26:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AEBBA22226 for ; Fri, 13 Nov 2020 14:26:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NS672UhP"; dkim=fail reason="signature verification failed" (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" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AEBBA22226 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:Subject:To:From:Date: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Owner; bh=XoLgIhO8ayyppXVDGrTT072W50memOR77+RPks+yUKE=; b=NS672UhPCRM+h8XzM+iNg4HLd KTS9Gg4PkckJXF0X8zk0G6KnXA1QzLkLVvmXPpcPEibLuQo0hUxk1xYNIdZ2gnx1M69jt1VFTWnJh KQoJ8xzSKiiZPFmk1VR1RLUQuV2yWXzMOlrLvdyeMK6v19MDlWR0HrOvwslI1uSxUj0Keq4/HNT0o WwbCxMbvV+mOIdY+/kuxxVpuai8c1xyRsAJFKw35trg5+7ByzKz5B49QCVLLGcsofMewI3esn6hli NfCv58n3c7hcrbT20ShkNf17Vfle0wHqgtpzIpbg+zvf7TKaGgdg/crcNkG3FBltAtW6HcQbmtaGU C98YWVlCA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kda0T-0006Tv-It; Fri, 13 Nov 2020 14:24:54 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdZzu-0006EC-2s; Fri, 13 Nov 2020 14:24:20 +0000 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 Subject: [patch 02/19] sh: Get rid of nmi_count() References: <20201113140207.499353218@linutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201113_092418_358499_8FD71BC8 X-CRM114-Status: GOOD ( 10.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Rich Felker , Catalin Marinas , Paul McKenney , Arnd Bergmann , linux-sh@vger.kernel.org, Peter Zijlstra , Richard Weinberger , Frederic Weisbecker , Valentin Schneider , Jeff Dike , Russell King , Yoshinori Sato , "James E.J. Bottomley" , linux-parisc@vger.kernel.org, Helge Deller , linux-um@lists.infradead.org, Will Deacon , Sebastian Andrzej Siewior , linux-arm-kernel@lists.infradead.org, Anton Ivanov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: