From patchwork Thu Nov 27 20:10:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 41649 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A5F172486D for ; Thu, 27 Nov 2014 20:11:08 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id l18sf3384857wgh.6 for ; Thu, 27 Nov 2014 12:11:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=4QCPEEtO4A1jSa4uotPOU/OLE4NeWW/xoKt5HS6g1lo=; b=NujkcBUR+YtoiOqJOch2JhY9Hl7bqT0mT4kFlELz5+MabE8qRtqk29YB3WPxMH1V8m Gl3hirbgP2yqlrTNnL/J8aTWBQshGygPRDPf2Cdd2jv94cn0RVT0MZLcG9LZ3f15vaek biAgROjgC0bvkInTuqYbVrShW6jDIds6c6Pjvr+AV2KlEj30fmhZg4C+l82JyimTowch jFFu0H6m6XTNxQ8UR8Fsl+pgEF2rAW5DJkz0gM95s1PSJj0ZLe7YC2aft8nd2Nf0qc/u 8hq3kNBPCTbpo5i998IZw1+//J82rinfPobcjqylARpar0xH6vlEn3qetcQ7xZEHn3hM 8UKw== X-Gm-Message-State: ALoCoQnAU8xkH82CXMPP7yNu9G6MVM3zLCzJehqPH1va9FVIVbHsQlpJ5NSIRNq7AIbJg6k3bWkK X-Received: by 10.194.95.74 with SMTP id di10mr1445158wjb.0.1417119067648; Thu, 27 Nov 2014 12:11:07 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.34 with SMTP id cr2ls374505lad.30.gmail; Thu, 27 Nov 2014 12:11:07 -0800 (PST) X-Received: by 10.152.37.100 with SMTP id x4mr40730463laj.22.1417119067491; Thu, 27 Nov 2014 12:11:07 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id bm5si8147252lbb.59.2014.11.27.12.11.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Nov 2014 12:11:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id z12so4650650lbi.18 for ; Thu, 27 Nov 2014 12:11:07 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr39908503laz.27.1417119067401; Thu, 27 Nov 2014 12:11:07 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp846554lbc; Thu, 27 Nov 2014 12:11:06 -0800 (PST) X-Received: by 10.180.88.165 with SMTP id bh5mr54411950wib.77.1417119066598; Thu, 27 Nov 2014 12:11:06 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com. [209.85.212.181]) by mx.google.com with ESMTPS id eo5si28706172wib.63.2014.11.27.12.11.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Nov 2014 12:11:06 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.181 as permitted sender) client-ip=209.85.212.181; Received: by mail-wi0-f181.google.com with SMTP id r20so9350313wiv.14 for ; Thu, 27 Nov 2014 12:11:06 -0800 (PST) X-Received: by 10.194.83.8 with SMTP id m8mr62902440wjy.58.1417119066359; Thu, 27 Nov 2014 12:11:06 -0800 (PST) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id dm10sm26635836wib.18.2014.11.27.12.11.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Nov 2014 12:11:05 -0800 (PST) From: Daniel Thompson To: Thomas Gleixner , Jason Cooper Cc: Daniel Thompson , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Sumit Semwal , Dirk Behme , Daniel Drake , Dmitry Pervushin , Tim Sander , Stephen Boyd , Marc Zyngier Subject: [PATCH 3.18-rc4 v11 2/6] irqchip: gic: Optimize locking in gic_raise_softirq Date: Thu, 27 Nov 2014 20:10:20 +0000 Message-Id: <1417119024-22844-3-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1417119024-22844-1-git-send-email-daniel.thompson@linaro.org> References: <1415968543-29469-1-git-send-email-daniel.thompson@linaro.org> <1417119024-22844-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently gic_raise_softirq() unconditionally takes and releases a lock whose only purpose is to synchronize with the b.L switcher. Remove this lock if the b.L switcher is not compiled in. Signed-off-by: Daniel Thompson Cc: Thomas Gleixner Cc: Jason Cooper Cc: Russell King Cc: Marc Zyngier --- drivers/irqchip/irq-gic.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 94d77118efa8..e875da93f24a 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -76,8 +76,23 @@ static DEFINE_RAW_SPINLOCK(irq_controller_lock); * This lock is used by the big.LITTLE migration code to ensure no IPIs * can be pended on the old core after the map has been updated. */ +#ifdef CONFIG_BL_SWITCHER static DEFINE_RAW_SPINLOCK(cpu_map_migration_lock); +static inline void bl_migration_lock(unsigned long *flags) +{ + raw_spin_lock_irqsave(&cpu_map_migration_lock, *flags); +} + +static inline void bl_migration_unlock(unsigned long flags) +{ + raw_spin_unlock_irqrestore(&cpu_map_migration_lock, flags); +} +#else +static inline void bl_migration_lock(unsigned long *flags) {} +static inline void bl_migration_unlock(unsigned long flags) {} +#endif + /* * The GIC mapping of CPU interfaces does not necessarily match * the logical CPU numbering. Let's use a mapping as returned @@ -630,7 +645,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) int cpu; unsigned long flags, map = 0; - raw_spin_lock_irqsave(&cpu_map_migration_lock, flags); + bl_migration_lock(&flags); /* Convert our logical CPU mask into a physical one. */ for_each_cpu(cpu, mask) @@ -645,7 +660,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) /* this always happens on GIC0 */ writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT); - raw_spin_unlock_irqrestore(&cpu_map_migration_lock, flags); + bl_migration_unlock(flags); } #endif