From patchwork Tue Dec 2 17:49:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jungseok Lee X-Patchwork-Id: 5422341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F2AD0BEEA8 for ; Tue, 2 Dec 2014 17:52:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A80F320295 for ; Tue, 2 Dec 2014 17:52:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EBD132024D for ; Tue, 2 Dec 2014 17:52:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XvraD-0006o4-6v; Tue, 02 Dec 2014 17:49:53 +0000 Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xvra8-0006Op-RG for linux-arm-kernel@lists.infradead.org; Tue, 02 Dec 2014 17:49:49 +0000 Received: by mail-pd0-f182.google.com with SMTP id r10so13523421pdi.41 for ; Tue, 02 Dec 2014 09:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; bh=9dRF9lOESVyRBCnPHKmXs7AnSmyIp3BNOr7dFZe2d0s=; b=LHMBTLuJ4LI8CKKuPUUtt/9Gb2AVVYCMOqmGVRCOtBfDfP44EPDYLvP9c2LpXAVvVw 9Eh3AHORdS+krQ4HJk7auNIdxQ/f7YkNyn4T3s8nJ2quDaVe33Rljwqf4RH5dhkd9DRC 1izBpaa4dq0LIhXAKBK6B73lE973RA0ooWUejHOuf5KBqIVl2a9pCxReFEsFQCbCjx/I B7GsMeDgIxpns82/Y+4VMeqGEU//WGg9cYWSW+unoWVlBkf9tSD6mGAGEZA7e00rzDne AQyWOcdkDf8CbgGAh3kaOvAxIVuP/0ZfJFzqscUAP1EJXfE8n1K6AjL7OgBnSOvdP52d Cpsg== X-Received: by 10.70.140.229 with SMTP id rj5mr945758pdb.60.1417542567173; Tue, 02 Dec 2014 09:49:27 -0800 (PST) Received: from [192.168.0.3] ([116.126.211.105]) by mx.google.com with ESMTPSA id fa9sm7696026pab.36.2014.12.02.09.49.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Dec 2014 09:49:26 -0800 (PST) From: Jungseok Lee Subject: [PATCH v2] arm64: Implement support for read-mostly sections Date: Wed, 3 Dec 2014 02:49:24 +0900 Message-Id: <3CC03DFB-6364-4AD9-8981-BB483DBFA85B@gmail.com> To: Catalin Marinas , linux-arm-kernel@lists.infradead.org Mime-Version: 1.0 (Apple Message framework v1283) X-Mailer: Apple Mail (2.1283) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141202_094948_942332_FBC64389 X-CRM114-Status: GOOD ( 11.58 ) X-Spam-Score: -0.6 (/) Cc: Will Deacon X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As putting data which is read mostly together, we can avoid unnecessary cache line bouncing. Other architectures, such as ARM and x86, adopted the same idea. Cc: Catalin Marinas Cc: Will Deacon Acked-by: Catalin Marinas Signed-off-by: Jungseok Lee --- Changes since v1: - move __read_mostly macro below #ifndef __ASSEMBLY__ arch/arm64/include/asm/cache.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h index 88cc05b..bde4499 100644 --- a/arch/arm64/include/asm/cache.h +++ b/arch/arm64/include/asm/cache.h @@ -32,6 +32,8 @@ #ifndef __ASSEMBLY__ +#define __read_mostly __attribute__((__section__(".data..read_mostly"))) + static inline int cache_line_size(void) { u32 cwg = cache_type_cwg();