From patchwork Wed May 3 14:51:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 98493 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp94927qgd; Wed, 3 May 2017 07:52:54 -0700 (PDT) X-Received: by 10.98.89.213 with SMTP id k82mr5338739pfj.196.1493823174193; Wed, 03 May 2017 07:52:54 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r133si11241268pgr.24.2017.05.03.07.52.53; Wed, 03 May 2017 07:52:54 -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; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.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 S1753550AbdECOwu (ORCPT + 25 others); Wed, 3 May 2017 10:52:50 -0400 Received: from mail-sn1nam02on0065.outbound.protection.outlook.com ([104.47.36.65]:31520 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752013AbdECOwn (ORCPT ); Wed, 3 May 2017 10:52:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=u5DAdcV8AKIdxGcyvkSdh3y291+i94LKJXVAGREvzig=; b=XxEnOK+JvCtnwhzixKOuQ5VsmUHs/Kg9u5aIW6lRRtDgwafIdcFuraxcMaTnjeLR7EU3UjkaIQ06yKjJnO0aHhDJvrImrVVJ+yZMaSe7SHV2hKgZJDgOEx+LsafjWD0hcGuqIpwHQZ8YxHKIE0Nh6e26a7eRXiu7FrmPsoJxgKU= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost (176.59.53.57) by BY1PR0701MB1269.namprd07.prod.outlook.com (10.160.108.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Wed, 3 May 2017 14:52:39 +0000 From: Yury Norov To: Will Deacon , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Yury Norov , Adam Wallis , Andrew Pinski , Arnd Bergmann , Catalin Marinas , Ingo Molnar , Jan Glauber , Mark Rutland , Pan Xinhui Subject: [PATCH 1/3] kernel/locking: #include in qrwlock.c Date: Wed, 3 May 2017 17:51:39 +0300 Message-Id: <20170503145141.4966-2-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170503145141.4966-1-ynorov@caviumnetworks.com> References: <20170503145141.4966-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [176.59.53.57] X-ClientProxiedBy: VI1PR0602CA0024.eurprd06.prod.outlook.com (10.175.26.162) To BY1PR0701MB1269.namprd07.prod.outlook.com (10.160.108.156) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea7cd74f-63ea-43b9-679f-08d492340bac X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1269; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1269; 3:u148ccG1MUs3i1fmLtln6+tEEzERPFw5Q7sp+BQ2J5RAy03d6FtF6J/zjHvuW8blX6Oix9q2UJ8vx/FaywCxURM46QmI8jbZBZwowuI96rwX/zSpUCbk9Swt/bMc4YHg/SpPgwL6YEQgZJw7Q25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9/1kBCHet/cx5/LWkaL77JDk3rcIe0w5Uw6dJhGIUacEOGyI2UH8NpViLJHVHOA9kU5mWLiI340pK7kRuqux4GbqcrA0qY8X6Ah1Q9JCT/stBjG7JZ3d+EI1s3mQ9VrbH75zNgFLUgLIIDw2CSvQtgVKTxDTmO6FmayxrWipdVZBuMaZPaq86MGIFCiel/dbORbu8xeQs9Kal6lQPLB5lh+BGG0jDktrn5ayhKkp75eqmDpF9IGkNCU1EhUO7Tl5tnH0r4DxoHpc0m4E8KT3fLNPUq6ElR4P+x/6IUw9VlQoQb7mgBjUs/UeAxI5Nt0D9tjehGr2PAV+NODJ2vDmsNzzv56TRDKtfiJO/Td54rhGMyyoHlKTqDAXgc49/7xDhxyhW7yT+ZMwmLRKrTbVGy0zLkRARMWVhNstoZH2Ee9lYeE4cCHxnuG/u9QcwkJ2s+oBrMg0bq2ZbbLJqrjlJjFqqJu+0MHnIoVub9cGvQNhzU6W/UCxxECG9+jIYgAOxSkts= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(6041248)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123560025)(6072148); SRVR:BY1PR0701MB1269; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1269; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1269; 4:oowKVbfsHsCuZnc/Vtvx7neW58QcKAhQHEfVKS2F/TV8feJH6femem7/K/JlKPgugjeO3622gGxLSVuwNRjKHD26OqJ4w6PH4Ikztyzc521K3qDhuqf+WUJ8sz8p+HJtkiM1SlhNudsCZfa2ye8HOTk+4pLWvu/eB+TrTryTVVUiVD29kNSXLtg/uKKtQ9hWyPKM+eUH9opToCvGHpqyVRhR+f5CyM4hUwvFlUMrsbObG9tvcLLOgwGKHFXy1MifBefT4hVRXf4qu+AY2R4sWpR7kZUR8hJpda095QVns61g6gUaos3NY6wpHki99gWgAw6dD3baryK0FUy8WmaVwL4XUH3VWkPcbQODo8ffDyfmBcrS/TsqtgjTgObo18ZoWwYE0qYTf1Hj9+krwzR7MgvtutkCShSR/nC/osy+hVKQheHbOWjh/qHWN3qp1NGbgGS2/MdpFHc6+QVn8fEvlnnOrgvdT9vGMVVFGMH8jbTNlKun6KPbyCT/wPh+WT8xg3+EWbdHXsk1oJahanvAKURaguGgRiQHQxkBROz5b48OMX1Tkunn/Ur1Ps5K5k2R7t8Q8Eq5h+NFFXz1QcWub+acvKomAXBymDQ5i4BhlcTp6jEhKlW+XpuswqdlqbEVVvWCPFNPqL6wPqDzGNKOQ8a59NtKt/PpKzd1pM/WN7Qn3Buxzl7BjimhdAJp4hH4lWz2zLt28bmHfd8sfQuO0QgI3Dcvu31spKPgrjkueC8AyBFoDUTi1M/T+72xKDACMd8B3Y79t953rydQIIA9zw== X-Forefront-PRVS: 029651C7A1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(39840400002)(39850400002)(39450400003)(39400400002)(36756003)(2906002)(54906002)(575784001)(53936002)(47776003)(2950100002)(42882006)(6116002)(7416002)(48376002)(305945005)(1076002)(5003940100001)(33646002)(5660300001)(50466002)(6486002)(7736002)(42186005)(3846002)(81166006)(8676002)(66066001)(38730400002)(4326008)(6496005)(25786009)(50986999)(478600001)(76176999)(189998001)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1269; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1269; 23:Mls1k5vUUhNCiwivS40qkkjrE/RizDB3zenty3vtnSWXPpBAZTGD6q2dEOAseMLDE/aBrnV0S4yaTq6aje+O5AqZapCknL4/FKDU1TiSTbuwx6vu5Vp+q8H5y4qz1BxkbFKjui2gZR4JRUEDYOZC5GyfEPB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OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2017 14:52:39.2260 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1269 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org qrwlock.c calls arch_spin_lock() and arch_spin_unlock() but doesn't include the asm/spinlock.h, where those functions are defined. It may produce "implicit declaration of function" errors. This patch fixes it. Signed-off-by: Yury Norov --- kernel/locking/qrwlock.c | 1 + 1 file changed, 1 insertion(+) -- 2.11.0 diff --git a/kernel/locking/qrwlock.c b/kernel/locking/qrwlock.c index cc3ed0ccdfa2..6fb42925b201 100644 --- a/kernel/locking/qrwlock.c +++ b/kernel/locking/qrwlock.c @@ -20,6 +20,7 @@ #include #include #include +#include #include /* From patchwork Wed May 3 14:51:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 98494 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp95096qgd; Wed, 3 May 2017 07:53:17 -0700 (PDT) X-Received: by 10.84.218.71 with SMTP id f7mr25391405plm.135.1493823197119; Wed, 03 May 2017 07:53:17 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e131si2688758pfg.189.2017.05.03.07.53.16; Wed, 03 May 2017 07:53:17 -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; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.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 S1753826AbdECOxH (ORCPT + 25 others); Wed, 3 May 2017 10:53:07 -0400 Received: from mail-bl2nam02on0061.outbound.protection.outlook.com ([104.47.38.61]:30349 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753704AbdECOw6 (ORCPT ); Wed, 3 May 2017 10:52:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ZaTPTyvIS6dl0l3Ru0HE449Z5xIWflpryo5sIZVxT+g=; b=BssSfxqfQriVUaNI325ibi/Re+XJWprLmXkzqQQ6+KbEr5X56G+oub8ImpMhWujiaq1+6LGY7SIV7DjCXLJf/e0RfOaPm539sJL62H8DIsQUPM5iME1HIGrraD7U5U9CxshNudHUHTDDZtSwzOQknfrMlTYJQCpfYeN5VFRXLZ8= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost (176.59.53.57) by CY1PR0701MB1274.namprd07.prod.outlook.com (10.160.149.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Wed, 3 May 2017 14:52:54 +0000 From: Yury Norov To: Will Deacon , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Yury Norov , Adam Wallis , Andrew Pinski , Arnd Bergmann , Catalin Marinas , Ingo Molnar , Jan Glauber , Mark Rutland , Pan Xinhui Subject: [PATCH 2/3] asm-generic: don't #include in qspinlock_types.h Date: Wed, 3 May 2017 17:51:40 +0300 Message-Id: <20170503145141.4966-3-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170503145141.4966-1-ynorov@caviumnetworks.com> References: <20170503145141.4966-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [176.59.53.57] X-ClientProxiedBy: VI1PR0602CA0021.eurprd06.prod.outlook.com (10.175.26.159) To CY1PR0701MB1274.namprd07.prod.outlook.com (10.160.149.17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b1a1e2f-541b-4e0e-0dcb-08d4923414c0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1274; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 3:51ExR/spmDaVpeIe3kc3T1f9o3ha2dYocVEFDZ8BUXBDSKyaEP+nXFkkVP1ybUdVDZb51Lam0maPvyyYY4OatqUOQ6FskYl/7xELnVUHmLncoufYWSavCuMoUBjNUpxtTqHt5YueUCJgo669ewV2+GUk4FKLMo8kkWH85PKDjvqAS0rSb290C2hKhWS9+LJSResChb/YxQ9UQZpUISO+FCI9RIfeJW+Vpm48xTZYb0kOupW3SUO9hEEaAxZmenbjQBWTDtQYU8INFgfn8iRWXlZsFjm9A2OmQJSHDe1zvEiSvKKtajzra9S9IP2k1SH1UIM1GWzJF44lR8L6PMQjGg==; 25:GwzvntPHgPCR1V7W1C2UUz5CaJCjedCBiYEv7p9Z2jXPhhhVnZXm/FRkssvOteJ9lIAL1bK7PxYSejdMxpbJ67n5OErcLvD1p0qNVvH55NAfFEP98sQPkuq53oUBqGmF+BDVBF2I9a2dE7oxwPJtn1FGdbdcUS9DpfzS/gFTjA6zhSY1jtdZsPhGbHS8NyRCIJ2j+YfeH3qiKrg3nEIFV2QstJKXQNl7FTj8eQTmewzBLyXogTh9lEd1+jWNIgvhoqqnVFrA2lD8bwJn5Qi7rybxrimh2pKmbVv9aj3XuN2JFv28zygJjSlU0k3DT8TzoDF9UoA+pMBmjreceT9bBUhOFQhJS9C3SX9t8x24DKUrK3bKk88rIAWAtGRmpN0gZp5OMvpXB2EOLHgaN2cXPNYf1jYtPB64ntDttZ2/34uzJLJgGeSPzfiUuGMxjZl1PKIBiE9A2AqHzJxQdHMHcA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 31:5PuPkvLy8Iep68aS2z+6IH4vtDCTK8UCp2gIqIotG9mK61jgXb0pazX8fUpvqasFJV2yzow0ZyeXyRSEssmnPL75FBjawvZRT2pIR6sIp5fa3o8hJS9tMITN8RCBSTIPNK3JlSABd1oywVVhazJ4IGKIg7lpImN237lSUlSzsUAEYWFGZc14IoDFoMOfOYC3xH4/dikV53LRjocnIAiGkY/whbDRyTB0sckEmA5rQUPZsmGU2bRDUTxnNl/gXLgR; 20:cj5aKf5iSQRIHJqp78hAhiAbM5fSLGlBlhU6qij2vZqK1O1LVDg4PvrpL9MfRlkbrBV2ZiGGPprOQlYbI+Q+FHT3zZy3PO9cSkapWycQlw6SMeZ2A3wGwuL+cK4+T+znqwR/9QPE559y6t4BZ73Hv1I1DbJ5RCKanAdJGw1wvw5OkuZvT0/3NbwgTLlyvEkyrwMBxA1jmNe+1VBVneEZqE7UjQhixn+K0gM5jxbgO7v2iK/Ns0GuEMcW6SAoJzH9SSI31Jer518e6zrqpANPd33uTulA0t2a+m4fNgB7gcZA04/xuVGq/j/m5ulZkYIox+YZvhd7IIG+FHVj6h+GB9Kc2B+thWvxLBruHGKGuF9s+ChHf3oMXmR2TawUdC6HbmsPahSc1T9Br++FquvoYvf9fTI+7uPMnYOeq2UCvkN0O0LhByyJGhu2C8hQ4hZHazrnvCYR++oAyShqQCo3ZGK+wvLkVZS3URBEd7vYK/544TA5/PBg+WV4xQ0+t0m9eDf6GguglBsQV5cOGg6NBK0W4f92Vo8T/7O2Ir9TL/cfvUCLCuzLGsasdGe2kWGl6QpyxvAPC6a+/lFzR3p4ivyJlILdQx2+K3l+nzaKfgs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(10201501046)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:CY1PR0701MB1274; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1274; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 4:5oIEYQ8nSVjgZHQHc1T09nD33DXNgRfc87G1aVsQZ8HoQIxw7lJg/KF++4JZP4IEQCCI825yO8scmHQSQEcpZWv3ATQEvpEbv5xFvS3GKtt+ZzAMJUXjKRzIXIdpxh4rNU7453U8A9JlExOtItd4JIq7EvF00yqlr8chK97OHd8fW27MQ5FMWiRdreg5WQU/achDxSzOMzVNMXWt1CFmZ4uKfPduUhw8+qDGDrg2BVFK/Mb/wNpx1SfyQ54A56Eo+QISKNkF1hBcEY2x3m/JtmAJj1uZrLtDT+mUwy6kcrmYjpRwOlx8KQ45jujIEycNHD0ZQIJxbYXP2MlHny0rFqFfDvZ0OrtnSM7eQ+Snytb6LPzX3+8Y98omfieu7iF52ASz5RJw/3DGjeDmODaRurRXnSNpjwRaPZ+QewOIGknt5kiitkuLbzQS1ut+bR05uvNXg7ezCw9P/Ge8T+I/gVL/66jbIIA0oRjljH4+X48XBViKXbZpg/4Yl+5ENhs0OD9MilRAhiAcGmbJaQlENtsUaTFMmgaR8LD83M1u3QpEhR+1JwG+N1E6JaayA4te7YybC34YW+P2umFQdrDnEUBtPNrgUgKA+GqiA3IlCietofGEzSos+zvcV8JkwC2klfPax8WysVxnK0rR2TjatJAlVFD0p1cWeULeObH5pcCkpKYTUWyc3TVtwv84p0SC X-Forefront-PRVS: 029651C7A1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(39400400002)(39450400003)(39850400002)(39840400002)(6496005)(5660300001)(6666003)(3846002)(36756003)(2906002)(66066001)(575784001)(33646002)(47776003)(2950100002)(42882006)(6116002)(7416002)(38730400002)(4326008)(1076002)(508600001)(50226002)(6486002)(305945005)(50466002)(5003940100001)(53936002)(48376002)(8676002)(81166006)(50986999)(25786009)(42186005)(76176999)(7736002)(54906002)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1274; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 23:ArjQdWbyxBlmFfwZ/r4c9ymo6WJKR634wnTBcDygNc93i6eMXgf8vqr3LCtnJCXAqLNucD48EZSEi7l2kMqeln64cXJ+qr5UDYbrSU5SckCq+fkUg/qkT6mIYLxrQ0WZDZjP/QX3eR13tjquBjOuxOyaiY9GJ9XsDXcPEzZ97XsApWfT8ZIQ3wSmHIkY224R3YLqb66UtGXqY3LeiaeyNYy9JWhlboKCIcV1kUDjstTdFoVu4gxmXWb0ROCexrGloO0/wQBpJv+uHLvuLHVitXlBxj7r/k/FsPZxycdGl5cPl+yWEIxeDQyQWXWmFKEAold2bCcsn2pD14Mdh/nliZ4HiEWCVFMWnaoAJzVgZCWYjEl7+QCoA9A+hEgcj53e9N4wwMWqeKeA7FqQz1xwn4Ge/iYhlZwYHmbMSZdtm/7BNMJxO/lGYbUALg9/yQK3qTGmFhCqXnMeVNpDQkI8+UnWFqUDTIr/eHaDj+f2+BtWLuVpw/CASIZ7Aa60fE5G7lfWtW0830XwwHTfWQkMCjkfoNEtLHQEj4XZexVAZY61UO7j+dMT8gw8TsXYhReXRwLYVntEWln1ktg8B4+L94Uz3DYmQNDPN9Xrykn+yiiHlyLth12mSiZuyPzxOtq9LmbhdqLCTzjLSDvuLX1Z+k4LM7xo874y44c97UPWTs4ijstBw+7PcAxZJDQBzNQgURafo96FwcHthB4FIDl8PjZJRnitD0Kig97o5RaBfqLsvBoDw5VdZdUHtyLLcuNWXHb8H2CNgTA5wObm/01NhyB/KuU9BjWkhMGpadxZjpPd4tNDQl8qV3TWQ91kMSVZMvdPx2/kEekSsfY7m0DyWE3qnl+VqfyP9otlfK84BQMQ5vvzqVy2aWj2wJNtKWty9FBof1kkJwjvEj1YpLtvMIz75/aNZNrMs9ZtlCoW2fKme8jDehpSmMULbgAkuh1bh2ScxO9drg59gBsmrHeuq5wPoTpqM2DFzcUSSNOw5C3onFqqUd/xLNA4g47CD8sARnCY2PDrEnFWpa+M7I+0+w== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 6:i4F70fBKLTgfX8Kk/QnAcMh8R4PUPplu0useSJfmyEqcqVQ56hIL6j8FYUVt8DKdgW3PnlYd8nyHn6woMyw9uNTfnziIU43kgRaTq1XCtxq4XpTkryrz7TAbNAspNxp7gHSk31DmyX6cXul7Ew4COZW6N1eOAeKCMHvqUkmeuPHIbWot/xKAjSzrQeEE/l5NkREO6ZkMiaDJG4gJkf8L8eN3y+tpLlMCD2ZQcK0plMkXc9OqupXTFE9FdxIwCRRwv6KkXFAiFkomNPOMlOUaqCPW6l+voXbd/Crjtt3mWkW62uI8rkvSnSed/G9nFe5MBGw6TfRZb1DI4uJpdO6f4UQfEbeFR2oAOkkxj3RV6Gdkm9XqD5tl46BuaVfhOJ3iLhdf3hqvvJvq++j18IZJoOL3/A47RMVFeImvrqmQ3B08/IfLr8qd60Dl1subQ1ibCSlA8ouKi6ph5kGlT12N9dnmCgCQL9wTp2qpR/ymJeURVnEH7azIyhHg+Edk53V3x6WlY2/i/fuLBDtJ0abHXw==; 5:x+Ynbi7ZyNimTqBarV9LwtRA6FGfm2iYrSez/tqm21fR8qiAlumvgInm4qHisom/O7UmOeCVuXPUzqCuO2lo443rHmsIjpwh5Ktio4SiHoKwUVenhV3eUZ5G43muHfaVsHJF4KxqbRu2ml/N3rq2ow==; 24:0Dfu2rM/1I8QHw2FazFWjxt4h/Xtiaq74cslSJgfeM3MzK1tTPb8wFzBriBuQEFtzGx7SA698Z1DWruOG1kepOR+kwD/IWas92QopNlKGFA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 7:+1FaD2xXhes1POmuujO7mCJEuSI0ImA064e3Y9zmWV9QZAC9sHnaU6HinL1S78i1nn1H1SUPHOQBGo9kE/lRcblD//syVcAyFZm4EpZdrMu9z2KdCirZFevkA2apTlNGZXuEq9ezuaC99hX2FFPMMfCF2pBdiSZF9erxxLAm8jmPUx+NJ2GB9R1UCcmVA4OGxTxuCDLDovpPHZc9Hy6nQhvXMn694RiVTdluHudMhPhtWf0eauAJDOfetyrF8sc7WNpCJ9/Yvtkk4FPmhJ9KMrAIzIpxNDfj/CLLrGFOLXVT5YBK4oRmFzS0y9qr7vQR7OXl0dXX3NxmWnmLcCgy2g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2017 14:52:54.4063 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1274 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The "qspinlock_types.h" doesn't need linux/atomic.h directly. So because of this, and because including of it requires the protection against recursive inclusion, it looks reasonable to move the inclusion exactly where it is needed. This change affects the x86_64 arch, as the only user of qspinlocks at now. I have build-tested the change on x86_64 with CONFIG_PARAVIRT enabled and disabled. Signed-off-by: Yury Norov --- include/asm-generic/qspinlock.h | 1 + include/asm-generic/qspinlock_types.h | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) -- 2.11.0 Acked-by: Arnd Bergmann diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h index 9f0681bf1e87..5f4d42a09175 100644 --- a/include/asm-generic/qspinlock.h +++ b/include/asm-generic/qspinlock.h @@ -20,6 +20,7 @@ #define __ASM_GENERIC_QSPINLOCK_H #include +#include /** * queued_spin_unlock_wait - wait until the _current_ lock holder releases the lock diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h index 034acd0c4956..a13cc90c87fc 100644 --- a/include/asm-generic/qspinlock_types.h +++ b/include/asm-generic/qspinlock_types.h @@ -18,15 +18,7 @@ #ifndef __ASM_GENERIC_QSPINLOCK_TYPES_H #define __ASM_GENERIC_QSPINLOCK_TYPES_H -/* - * Including atomic.h with PARAVIRT on will cause compilation errors because - * of recursive header file incluson via paravirt_types.h. So don't include - * it if PARAVIRT is on. - */ -#ifndef CONFIG_PARAVIRT #include -#include -#endif typedef struct qspinlock { atomic_t val; From patchwork Wed May 3 14:51:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 98495 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp95254qgd; Wed, 3 May 2017 07:53:36 -0700 (PDT) X-Received: by 10.99.96.73 with SMTP id u70mr22348591pgb.29.1493823216344; Wed, 03 May 2017 07:53:36 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si20600726pgj.277.2017.05.03.07.53.36; Wed, 03 May 2017 07:53:36 -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; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.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 S1754081AbdECOxc (ORCPT + 25 others); Wed, 3 May 2017 10:53:32 -0400 Received: from mail-bn3nam01on0082.outbound.protection.outlook.com ([104.47.33.82]:38544 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753986AbdECOxI (ORCPT ); Wed, 3 May 2017 10:53:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=b6gqZSKFuouWpBvaOG42hsqLiZ1bN/ehNeYCh23P4cU=; b=PfE1r7AydbLZazB+aRXdklzy/hWQMqZrO6YIzIby4csSTGYm5/KgHeIGhqR32odLYZr7fx4OrX6Hun7VbAL0xiy6CwwWPTZKEI8d45xX4Y9i7elPtFfewZlHL9/uNQy+O4l3GpleAvz78r4pPQraGtD6+fTqWo6pMQ4OlQnOCgY= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost (176.59.53.57) by BN3PR0701MB1268.namprd07.prod.outlook.com (10.160.118.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Wed, 3 May 2017 14:53:04 +0000 From: Yury Norov To: Will Deacon , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Yury Norov , Adam Wallis , Andrew Pinski , Arnd Bergmann , Catalin Marinas , Ingo Molnar , Jan Glauber , Mark Rutland , Pan Xinhui Subject: [PATCH 3/3] arm64/locking: qspinlocks and qrwlocks support Date: Wed, 3 May 2017 17:51:41 +0300 Message-Id: <20170503145141.4966-4-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170503145141.4966-1-ynorov@caviumnetworks.com> References: <20170503145141.4966-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [176.59.53.57] X-ClientProxiedBy: VI1PR0602CA0015.eurprd06.prod.outlook.com (10.175.26.153) To BN3PR0701MB1268.namprd07.prod.outlook.com (10.160.118.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e7a91c5b-15a5-4756-a7fc-08d492341aad X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN3PR0701MB1268; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1268; 3:Wnqyd7oscOYM/7dEL66c0csRdZohj+RO4KQQGSc5kWDdPfNPTo5l4JXjj4Cmke0Z8Hcbxdqkr82RU6Jsch4qCk0CqaxTH6QlKMYorD4m41MTA2nlLNPC2LKPvpVOHfPE7tTGuM9ZEnE/vMXDWq4M7Abx0G8M4NAR3FbcjM8aUc4xEp4IW6t+OmFxwoU3oDv6tL2ReY4k8LZ8l+k8gPxIdIPuJDm7pwjlyooFvCfjDBxtHMlC+qCDzsoC++DL8iPHKTJ9azQV28EHzmWTI6HA2orqrOfmp3Z0Z2XivW6o2kJi97iq8y3x4mUph/kE2INsPJ9HAiiNTd8IzEnph6Jysw==; 25:H6PxfvCFsbawLOqOKSrZHBVGn/q130P/xkc2/PPl3DuFpuxqCBO+qzlWiZvQ26WUyMtvqGIWcJUFF36inap1GchVIwPr7Hev+j9v4W7KM3x0/2q5Yq8ti84FY8w7laeVe0JsA4UppfGb27qO4SHayFRIK60m4s9WO13qZlKS1/Ns/7zt7VNGUcwsh4HXfPUvrBa+JQ7+KyUAgqq0lyzO4QvRQeL9QSedIATuFAEa1iLgdGvxOFZhr+j9j0L01V4a6vuaWAnPHR1C5OkLXSTLa0PMBkiSziIu69jvtFeG+pOcUwSXbMnQAxaCht0v//TU7GZLxszhvIeWQNFgshpNofmUBFpoKwIIvhn+6gj9aFeC7p1szbK53VMfbFOKCps9BmHDAi0xs0CR7h/gqDhOo5h9PeUMIXbZ/fqleARZEOPm8KoujcmR+2pd1qRsmGMandRF7p5C+rjI/3pfNznUjg== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1268; 31:NakcYaETmrViOiGcjb9YoH6x5LAflqRIScdp5ILZsGgxmpdaPTnBCBUgBn1ooYDjCiaTWwgZ2b8ByCrq8Etk91FSkk8EzP+oNaRk8o5LxQk9FNtJWfRSGhS4Tu4wxTfcqb12zFhLXMJm28LezUvHodrm+iKLjo8mA6mmRTMqe802veezzNNQ8v2o69c91YJlH26s3Sv7pn82fQgaUXm9OgfZSBjjAjkKKeLknRoY0zl2NvYrtyKIG1k4oKDPMLWL; 20:V9VGxKYjIZvgOmMT/0bZK/Z0G84/lAm3sY3qVwcoyW0E2+hkCV54Yytu2qY/KwPdYhLCiV496gptwSIHJCN1dXMVrbvy0JcUPr4nCB5kfXfceR1UfK3jtNkCkwlKECMaiErIdb4cGHOicISzU5LLGMpFB9rlTrkbG+H392pRV8rKM7V+4GARrozMUiPrxbjcEYbtvceKuU+Ngq2b8dlU5+HcegxexjqjvfNcz/pBeeOFIeY3BSxInMCIhgJekY6GvU99QiUs3mbNAUihr8tcXzrJCIcUPXo2CRcO3FWSDcrqMi6Ut6m6sHUc7z+3LQekHAPVHKouM6wYGVqrVM7l/OV869eeWshBgrmqFpPGC+mnes5rQQTPghfi9vsmns+xZlKLd6PQL+asN+bQo5hQV9hKGY3ftLuDAmnr6CcZZAkl5HBHAMF0UCJWtUESSChwU9o54RbbIUqE+0l3qqG1wPkm5EXBFmX/hdgpq3oDf8YT9THNyeRdqSbGBTHPH7niw2OrbndwKePMBAouwsXvJDmShLptM/NBxSpQKc2Klo+to6ekuOa2F+WWJA+1dhD/9GBCAx4lzNt2+oST3rrMaC4zXLWrdybc0UJfc4x3w8E= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(190756311086443); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(6041248)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(6072148); SRVR:BN3PR0701MB1268; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1268; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1268; 4:GZEti4y+KLQTWAUTVXnM2fLXLIpBB/fxOlwyUp12SudxyRA+CjbLcQgyW9c1NDroE6bgfBSP+iVWpLBvF9/X3riFGXV2ndDBgyS19mHKUxsMdP1+5LJmnWWjz2PXOe8kCQfYQTy0kL++mBzUI2H7bXBJHr8OQQVMwsu4DYGRicnkE/MuAj0VLUpg6a1cJ04EBdjW59jKjdVzpqUnT9U509ARmmJKwqEIe/8Zs7/CM0nneko5dr/x7AH9yeANRQCMehF0o2c8MaClW2T2jTEM0gDDAWTUomx87WssF9JtnFffcawdxSR24mEWJb209IT34HHtg+Iz0LFEytWEj2wqxVZbDcNGv6lNwmzCDNPjHPbOU4uKTEBR8xw7C9zGNrAF46g1J4DBnV2/32zOhAff2nCO+7IvDAHQLgpEWEua3r+/NtJaLfI55uqXdZmsgyUNb7ocjZVfTnJY1pIIOoaUcOuwEkdNrUAQZbZ0tKnhPExQFC3cGCFJRr7g02Nnndsr0C2li09F28dKAz+x2WCeNzK9n4YcWEVo3sU1WuKrOt8xRhykw283V7fyxHVzXlEiVOsn+OjDz0klV71hkujmpmxNn9uuA6d1/9MotCK14Irm3Ch7o+ypOB3avFHgLLObB1Bii++Kn4akIGLuoqE/QR54mywxo66h5r/D82Yqc7JO4vs+RHpaEisOgTGXVp4W0KfOYY/0Z008CWkEqkfoHj4zc6EKUJVZ0+Gii8eq3ex2eJCwKhz4aLOP4jjYdDV6iff2ZNIMHxh05P5JdITYG0G0z+EN3cNfUknBk/rlbdqCgHqTlJO9RBND2jIdmKt2 X-Forefront-PRVS: 029651C7A1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39850400002)(39450400003)(39840400002)(39400400002)(2950100002)(7416002)(5660300001)(25786009)(42882006)(1076002)(6666003)(189998001)(305945005)(478600001)(5003940100001)(4326008)(36756003)(575784001)(6116002)(50986999)(2906002)(48376002)(7736002)(50466002)(3846002)(33646002)(53936002)(47776003)(66066001)(6486002)(38730400002)(8676002)(50226002)(54906002)(6496005)(81166006)(76176999)(42186005); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1268; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1268; 23:qg+pw5DjF6DFw1r/JCOO/XWsFkUIhqFVBVc84Qx+hjq2eoF9SnfOLuGrzT7qRsQ2DOVmM7viI/opZswlpk3lT581XZTQZAD6fQSwgnmbYikr8rQNXqGoE5CWg1rSbUtFWRydf43zXq18kLsjKmDIJhp5859DJAbMVf/+ENrsIPazpv+UW7rSW16holj9fYPyou5wi/8x55qCuM8HVT9DcXZLQAUZe0ychQSS5Wlz3Y/vlSpSECDFXwaMp5yAiWtNHD9/5scgzMihX0eup4MmPs6xvxYzvKhPqlflhVJtcgmRmPswgT+ca/vInjMc3jlG3C24p2b3r1ktnq5mAgfoUpGd21y1XzDJUED80MzG6e8xNJ+tVrRicYhjwgQ2QBAsZCjh2DvG8xCpLP5Bsaw7qgyYcsyzdwbFfUFYFlcX5K7QYO0FKvRckHTIKTjdF6vXpVrgGeGdEtDvM5gZXMQjuwO29yMXxBKr5LfjzFpIrWbwdEopYI2XP0RVxxKZNwupDJ/E3fxM/k2lAbT+MaJxmcAua+LxO3n+1I8VX08pBorF/oi3W/ct3xp8wOpnIsKj1SH2rWF6QX4SPs2FDss4UvxwA/2UrX/4z2Tnt8sUHTpLddMTCa5gACBx6m8noSPDtStal9uVpyr1RrQezRgW00EKzJc8B5hXBOInX+NBlAz8aeENRph1fJqiEOqIqzyQPfq0fIXXv+9swYodTbMzdG1zCUU7sISWgisOm1yrnD7/Po1EG/UvQKJVs5hRU/XpzxkW0NVHeOQWNJ9cXA4YGgUcP3JA8MOMfrBjGt6rTeUJEnVinT9c3fIOTBbkpPcN93UE2kDuTzz5pKJuLt2teRyN0iMee4Wo2mnriEx7M3kMj1R4GPHbGdapTI6oOxQlSRQsXfk/2U7JagRu8BDyeGmaudruYcSynq4/ImzDWw+wwQs3AVvkUnvyXF1Fp2VkZIsGIZPDJLoUsc64lpfp3RVY0anViYRRnoBs+RU2746Rmy+qcihxCics9z5VTiHgA5lez/KOzstmH+UHiOmCtw== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1268; 6:vpSdyy/NUAyv7tghLFsijGYJRr/9CR7sIyVMRysVyMBYxQP+5YnCR3kZgtBjuJ+6dK03ALaiezg9YJKhhJk0nww9ilp9NywvRmEkAWzexviDJi+orEtVa8rSb0BCvXOsjPZvlH81lS5rGH98ZAdd2gQSHsXTtP6O8d7lxEZxArgfjTxskWONjYOj1u61qCBv7E0puYVWe652WfH0BySnxe0hoSmwviuH4HtqjEkHLYCzlJRNiJi8OSz59EcAlefE4GvpsPvT3YeKRIG7jvOjigMT5BG43kaRkRWhEaxNwa95/X9RNUxMOdU22avIVj9TLOgyqHa9RYw7WB6Hh9AE7fjVjqfQ009k322YJV4sDjLs3hcaPxSuGyiSovUYZ0l50TVKOkQo25wX3s1xMPlA1CBuoImWBaF7mMAoUJPf4/6dbcBVLnCbN7cT/5m48va6lDp3GuDuR847CkU/MI/n4+cXKiAbApyeXnHiK7bBLISZK6e1K9F2uW3mScVU3Sv0q6jwuXJ4Bag7Lu+2VV+8Dw==; 5:9dj5bjqzqsCBn4ZXW+JHxL82zrQgsh7lrkCY7dSDgAgRuK6SCgv8XPRR8g1Vk3BeNRwYTl92LD87p53EdWGmQIRtdgji+8ZaoQ3Swfs4v1D0M07nuijpTCFJFQ30Fxjk9Reh5/xJlhgm3aMFnl0Yyw==; 24:dcPkY+5wVRng5ACERph80+LcAJqx0DoU3s+y0rkq4Rs+Ir7PdqbcZBMLki/jJ5qgFnz5kJAssppVcauU2JhOuI0hZOdfz5UbnlM1tpjqTf8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1268; 7:6r0jmxk3va+eMQsWIh0GIJwBD3mIHyLJmIQNVy3TFqkANc1ynWCQ6OV8cfxhrefqWk6dBhI8BFW+m9jKscJIaseDDHphmm31VoX5wW9aYkQcTIT49T9tMdyucIl2PwlygcJ7uw7kHCjkYB845M3WxHn488rZ3hRXUeCA64FT4R69Xc7f49jvbCbBO1pHpwndDnoxLpvvsflv7RMCcNS5+TA0/5UD6I3wjJBCzZbMLIRrIboHSdZhDnW40LYhuvIKbM4Cr9NzslRsGNUeOoL+/1+kiIXdA/fLUm86dShtweNXveoikr/Kp8m0DNH2l7id3UaJggJOx+LxDLeyBUXJKw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2017 14:53:04.5719 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1268 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Glauber Ported from x86_64 with paravirtualization support removed. Signed-off-by: Jan Glauber Note. This patch removes protection from direct inclusion of arch/arm64/include/asm/spinlock_types.h. It's done because kernel/locking/qrwlock.c file does it thru the header include/asm-generic/qrwlock_types.h. Until now the only user of qrwlock.c was x86, and there's no such protection too. I'm not happy to remove the protection, but if it's OK for x86, it should be also OK for arm64. If not, I think we'd fix it for x86, and add the protection there too. Yury Signed-off-by: Yury Norov --- arch/arm64/Kconfig | 24 +++++++++++++++++++ arch/arm64/include/asm/qrwlock.h | 7 ++++++ arch/arm64/include/asm/qspinlock.h | 42 +++++++++++++++++++++++++++++++++ arch/arm64/include/asm/spinlock.h | 12 ++++++++++ arch/arm64/include/asm/spinlock_types.h | 14 ++++++++--- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/qspinlock.c | 34 ++++++++++++++++++++++++++ 7 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 arch/arm64/include/asm/qrwlock.h create mode 100644 arch/arm64/include/asm/qspinlock.h create mode 100644 arch/arm64/kernel/qspinlock.c -- 2.11.0 diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 22dbde97eefa..db24b3b3f3c6 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -25,6 +25,8 @@ config ARM64 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION select ARCH_WANT_FRAME_POINTERS select ARCH_HAS_UBSAN_SANITIZE_ALL + select ARCH_USE_QUEUED_RWLOCKS if QUEUED_LOCKS + select ARCH_USE_QUEUED_SPINLOCKS if QUEUED_LOCKS select ARM_AMBA select ARM_ARCH_TIMER select ARM_GIC @@ -692,6 +694,28 @@ config ARCH_WANT_HUGE_PMD_SHARE config ARCH_HAS_CACHE_LINE_SIZE def_bool y +choice + prompt "Locking type" + default TICKET_LOCKS + help + Choose between traditional ticked-based locking mechanism and + queued-based mechanism. + +config TICKET_LOCKS + bool "Ticket locks" + help + Ticked-based locking implementation for ARM64 + +config QUEUED_LOCKS + bool "Queued locks" + help + Queue-based locking mechanism. This option improves + locking performance in case of high-contended locking + on many-cpu machines. On low-cpu machines there is no + difference comparing to ticked-based locking. + +endchoice + source "mm/Kconfig" config SECCOMP diff --git a/arch/arm64/include/asm/qrwlock.h b/arch/arm64/include/asm/qrwlock.h new file mode 100644 index 000000000000..626f6ebfb52d --- /dev/null +++ b/arch/arm64/include/asm/qrwlock.h @@ -0,0 +1,7 @@ +#ifndef _ASM_ARM64_QRWLOCK_H +#define _ASM_ARM64_QRWLOCK_H + +#include +#include + +#endif /* _ASM_ARM64_QRWLOCK_H */ diff --git a/arch/arm64/include/asm/qspinlock.h b/arch/arm64/include/asm/qspinlock.h new file mode 100644 index 000000000000..09ef4f13f549 --- /dev/null +++ b/arch/arm64/include/asm/qspinlock.h @@ -0,0 +1,42 @@ +#ifndef _ASM_ARM64_QSPINLOCK_H +#define _ASM_ARM64_QSPINLOCK_H + +#include +#include + +extern void queued_spin_unlock_wait(struct qspinlock *lock); +#define queued_spin_unlock_wait queued_spin_unlock_wait + +#define queued_spin_unlock queued_spin_unlock +/** + * queued_spin_unlock - release a queued spinlock + * @lock : Pointer to queued spinlock structure + * + * A smp_store_release() on the least-significant byte. + */ +static inline void queued_spin_unlock(struct qspinlock *lock) +{ + smp_store_release((u8 *)lock, 0); +} + +#define queued_spin_is_locked queued_spin_is_locked +/** + * queued_spin_is_locked - is the spinlock locked? + * @lock: Pointer to queued spinlock structure + * Return: 1 if it is locked, 0 otherwise + */ +static __always_inline int queued_spin_is_locked(struct qspinlock *lock) +{ + /* + * See queued_spin_unlock_wait(). + * + * Any !0 state indicates it is locked, even if _Q_LOCKED_VAL + * isn't immediately observable. + */ + smp_mb(); + return atomic_read(&lock->val); +} + +#include + +#endif /* _ASM_ARM64_QSPINLOCK_H */ diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h index cae331d553f8..37713397e0c5 100644 --- a/arch/arm64/include/asm/spinlock.h +++ b/arch/arm64/include/asm/spinlock.h @@ -20,6 +20,10 @@ #include #include +#ifdef CONFIG_QUEUED_SPINLOCKS +#include +#else + /* * Spinlock implementation. * @@ -187,6 +191,12 @@ static inline int arch_spin_is_contended(arch_spinlock_t *lock) } #define arch_spin_is_contended arch_spin_is_contended +#endif /* CONFIG_QUEUED_SPINLOCKS */ + +#ifdef CONFIG_QUEUED_RWLOCKS +#include +#else + /* * Write lock implementation. * @@ -351,6 +361,8 @@ static inline int arch_read_trylock(arch_rwlock_t *rw) /* read_can_lock - would read_trylock() succeed? */ #define arch_read_can_lock(x) ((x)->lock < 0x80000000) +#endif /* CONFIG_QUEUED_RWLOCKS */ + #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) diff --git a/arch/arm64/include/asm/spinlock_types.h b/arch/arm64/include/asm/spinlock_types.h index 55be59a35e3f..0f0f1561ab6a 100644 --- a/arch/arm64/include/asm/spinlock_types.h +++ b/arch/arm64/include/asm/spinlock_types.h @@ -16,9 +16,9 @@ #ifndef __ASM_SPINLOCK_TYPES_H #define __ASM_SPINLOCK_TYPES_H -#if !defined(__LINUX_SPINLOCK_TYPES_H) && !defined(__ASM_SPINLOCK_H) -# error "please don't include this file directly" -#endif +#ifdef CONFIG_QUEUED_SPINLOCKS +#include +#else #include @@ -36,10 +36,18 @@ typedef struct { #define __ARCH_SPIN_LOCK_UNLOCKED { 0 , 0 } +#endif /* CONFIG_QUEUED_SPINLOCKS */ + +#ifdef CONFIG_QUEUED_RWLOCKS +#include +#else + typedef struct { volatile unsigned int lock; } arch_rwlock_t; #define __ARCH_RW_LOCK_UNLOCKED { 0 } +#endif /* CONFIG_QUEUED_RWLOCKS */ + #endif diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 9d56467dc223..f48f6256e893 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -56,6 +56,7 @@ arm64-obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o \ arm64-obj-$(CONFIG_ARM64_RELOC_TEST) += arm64-reloc-test.o arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o arm64-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o +arm64-obj-$(CONFIG_QUEUED_SPINLOCKS) += qspinlock.o obj-y += $(arm64-obj-y) vdso/ probes/ obj-$(CONFIG_ARM64_ILP32) += vdso-ilp32/ diff --git a/arch/arm64/kernel/qspinlock.c b/arch/arm64/kernel/qspinlock.c new file mode 100644 index 000000000000..924f19953adb --- /dev/null +++ b/arch/arm64/kernel/qspinlock.c @@ -0,0 +1,34 @@ +#include +#include + +void queued_spin_unlock_wait(struct qspinlock *lock) +{ + u32 val; + + for (;;) { + smp_mb(); + val = atomic_read(&lock->val); + + if (!val) /* not locked, we're done */ + goto done; + + if (val & _Q_LOCKED_MASK) /* locked, go wait for unlock */ + break; + + /* not locked, but pending, wait until we observe the lock */ + cpu_relax(); + } + + for (;;) { + smp_mb(); + val = atomic_read(&lock->val); + if (!(val & _Q_LOCKED_MASK)) /* any unlock is good */ + break; + + cpu_relax(); + } + +done: + smp_acquire__after_ctrl_dep(); +} +EXPORT_SYMBOL(queued_spin_unlock_wait);