From patchwork Mon Sep 10 19:45:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1433561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 0D131DF28C for ; Mon, 10 Sep 2012 19:49:17 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TB9vn-00051C-Is; Mon, 10 Sep 2012 19:46:03 +0000 Received: from mail-oa0-f49.google.com ([209.85.219.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TB9ve-0004yd-5L for linux-arm-kernel@lists.infradead.org; Mon, 10 Sep 2012 19:45:55 +0000 Received: by oagh1 with SMTP id h1so777950oag.36 for ; Mon, 10 Sep 2012 12:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=1WixyzQyEzKoxvfpePvwT1NYtF+1YdD6F2BH05eefpo=; b=mczqIN4UGymBZRBBnnBKrDQXNpmBCa6PjIHZJuOYn6v0fpRjxKvhBHhRprEodewWzd DvUhrZPqLkQhxl/FBVDJeEFKML2hBGORlljpA8vMUqGDpwLHVMV790M41tsE/bQYRPjV HIZdzxkNoL0zlExhGNXmaLhT+FEb2Z4/JGg/MJAOVknlD/4xhE5SXaOE+qbdSYwpD7ns sY4mzYk5wLG2zrxcPSZNm1MsUTGCa5iXzqaG0bZlOcUANnL9GhEYR5d2cnDfVCDfPiP9 Jx28++/fhXQauP2mKE0XdM6HLBihucPln69nwxsh9kC4GtBFQezzh4Z0yX6t9JGqKIYn zW9g== Received: by 10.60.170.47 with SMTP id aj15mr15604294oec.29.1347306352765; Mon, 10 Sep 2012 12:45:52 -0700 (PDT) Received: from rob-laptop.calxeda.com ([173.226.190.126]) by mx.google.com with ESMTPS id zn9sm14060575obb.23.2012.09.10.12.45.50 (version=SSLv3 cipher=OTHER); Mon, 10 Sep 2012 12:45:51 -0700 (PDT) From: Rob Herring To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH] ARM: l2x0: avoid spinlock for sync op on pl310 Date: Mon, 10 Sep 2012 14:45:34 -0500 Message-Id: <1347306334-781-1-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.219.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Will Deacon , Russell King , Rob Herring , Catalin Marinas X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Rob Herring The sync op is atomic on the pl310, so a spinlock is not needed. It can be a bottleneck for code paths with register accesses, so remove it. Removing it gives a 30% improvement to pktgen throughput on highbank. A similar spinlock removal was originally done by Catalin Marinas[1], but the spinlock part was dropped in the merged version. It is unclear why other than it was not a runtime selection. As every readl/writel causes a outer_sync, the sync function is likely the most critical. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2010-August/024514.html Signed-off-by: Rob Herring Cc: Catalin Marinas --- arch/arm/mm/cache-l2x0.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 2a8e380..6778238 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -130,6 +130,11 @@ static void l2x0_cache_sync(void) raw_spin_unlock_irqrestore(&l2x0_lock, flags); } +static void pl310_cache_sync(void) +{ + cache_sync(); +} + static void __l2x0_flush_all(void) { debug_writel(0x03); @@ -335,6 +340,7 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) sync_reg_offset = L2X0_DUMMY_REG; #endif outer_cache.set_debug = pl310_set_debug; + outer_cache.sync = pl310_cache_sync; break; case L2X0_CACHE_ID_PART_L210: ways = (aux >> 13) & 0xf;