Received: by 10.213.65.68 with SMTP id h4csp1058433imn; Wed, 28 Mar 2018 19:30:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx49JJSHHyjAGQxS3uV6ub7Uyv19ds2hr/OF82h2jURaPXjniaca/HHR/9D7IEe5xkqhr0ie6 X-Received: by 10.101.76.129 with SMTP id m1mr4169416pgt.90.1522290629269; Wed, 28 Mar 2018 19:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522290629; cv=none; d=google.com; s=arc-20160816; b=W49U/h3aK7+Ex1J6whPGzK31BDxHO+hw207febyfGqVPrb/rTliRYfjCNnZQX8mw2Q 43I9ahhMCbhKWZ29Bd75zFRB2yhNuL3Wd7V1KWG0zvxWwZceT3ruhO1zEnk+8DnOBwfr kEdfOTeLCFXGqqsWD/kGRhNS9HAKNAd5x5ThMgt9ALfQCPKzOxyGpHxbIVOsVRR60IZg 13gPZkHakHg9VjpsesbeFGvXOm5GzOxmlBmUAyvt2SU/ihkQ5ktbWFzQbjwnwDTr4Bce dD6oRUBE7QD6VxT8+HpN4u5kAzDcrzknUTOjG1Np8pvHNMX3IzpeFCpn2nOHcAGytxB8 T0Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:arc-authentication-results; bh=da/NSHvTzaYeKU7OKgFEl1qmrkAxm528W6agM5ffLQ8=; b=qBB9aum2DPD+imgJaC2zhtM0HOGYBBS8MJ9OXoayVOAW0jCl0JWmCgq2xKOOrdubKd aSrihU2kh9HuCOwT2yHvRQsvx/Lqyk+XYlTGnDOg+Z61y5qrITXHamF843PevHNhzxA5 jr5+V8iL+2SgMx4HSIfbcj9jh5B+CEcJWYDN9gc+aRFZmCBYXTdrpWKfpmx+4ttCvSk4 a1hKwoKOceabSlqV6c0Dmeukop5zQRqbSwELy/uFxSJl2nJKpCoxYGewFc0deGElolXJ qO2ZRqBO469B7fxlYT1eDxerkUlo6PFUn/C3tvsixq1IJJo6QgGhVN+p6LGAcp0q69vF PCkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si3317408pgq.230.2018.03.28.19.30.15; Wed, 28 Mar 2018 19:30:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752077AbeC2C1b (ORCPT + 99 others); Wed, 28 Mar 2018 22:27:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:42278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751147AbeC2C1a (ORCPT ); Wed, 28 Mar 2018 22:27:30 -0400 Received: from lerouge.home (LFbn-1-18526-44.w90-101.abo.wanadoo.fr [90.101.68.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0985E21835; Thu, 29 Mar 2018 02:27:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0985E21835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=frederic@kernel.org From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Sebastian Andrzej Siewior , Tony Luck , Peter Zijlstra , "David S . Miller" , Michael Ellerman , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Fenghua Yu , "James E . J . Bottomley" Subject: [PATCH 04/10] softirq: Consolidate default local_softirq_pending() implementations Date: Thu, 29 Mar 2018 04:26:59 +0200 Message-Id: <1522290425-22844-5-git-send-email-frederic@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522290425-22844-1-git-send-email-frederic@kernel.org> References: <1522290425-22844-1-git-send-email-frederic@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Consolidate and optimize default softirq mask API implementations. Per-CPU operations are expected to be faster and a few architectures already rely on them to implement local_softirq_pending() and related accessors/mutators. Those will be migrated to the new generic code. Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: David S. Miller Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: James E.J. Bottomley Cc: Helge Deller Cc: Tony Luck Cc: Fenghua Yu --- include/linux/interrupt.h | 14 ++++++++++++++ include/linux/irq_cpustat.h | 6 +----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 69c2382..01caeca 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -434,11 +434,25 @@ extern bool force_irqthreads; #define force_irqthreads (0) #endif +#ifndef local_softirq_pending + +#ifndef local_softirq_pending_ref +#define local_softirq_pending_ref irq_stat.__softirq_pending +#endif + +#define local_softirq_pending() (__this_cpu_read(local_softirq_pending_ref)) +#define set_softirq_pending(x) (__this_cpu_write(local_softirq_pending_ref, (x))) +#define or_softirq_pending(x) (__this_cpu_or(local_softirq_pending_ref, (x))) + +#else /* local_softirq_pending */ + #ifndef __ARCH_SET_SOFTIRQ_PENDING #define set_softirq_pending(x) (local_softirq_pending() = (x)) #define or_softirq_pending(x) (local_softirq_pending() |= (x)) #endif +#endif /* local_softirq_pending */ + /* Some architectures might implement lazy enabling/disabling of * interrupts. In some cases, such as stop_machine, we might want * to ensure that after a local_irq_disable(), interrupts have diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h index ddea03c..6e8895c 100644 --- a/include/linux/irq_cpustat.h +++ b/include/linux/irq_cpustat.h @@ -22,11 +22,7 @@ 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 independent irq_stat fields */ -#define local_softirq_pending() \ - __IRQ_STAT(smp_processor_id(), __softirq_pending) - - /* arch dependent irq_stat fields */ +/* arch dependent irq_stat fields */ #define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386 */ #endif /* __irq_cpustat_h */ -- 2.7.4