Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758509AbcCCWRb (ORCPT ); Thu, 3 Mar 2016 17:17:31 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:51467 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758360AbcCCWRa (ORCPT ); Thu, 3 Mar 2016 17:17:30 -0500 To: linux-kernel Cc: Will Deacon From: Marc Kleine-Budde Subject: DWord alignment on ARMv7 Message-ID: <56D8B7F2.4050602@pengutronix.de> Date: Thu, 3 Mar 2016 23:17:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XAmoMxp5D1p7tHvSwJQotb3WdgDS1E9gB" X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2464 Lines: 68 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XAmoMxp5D1p7tHvSwJQotb3WdgDS1E9gB Content-Type: multipart/mixed; boundary="Mq2kAvwp7uq3S49hWvEFtFFlKcRfUMj4s" From: Marc Kleine-Budde To: linux-kernel Cc: Will Deacon Message-ID: <56D8B7F2.4050602@pengutronix.de> Subject: DWord alignment on ARMv7 --Mq2kAvwp7uq3S49hWvEFtFFlKcRfUMj4s Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, I'm using btrfs on am ARMv7 and it turns out, that the kernel has to fixup a lot of kernel originated alignment issues. See /proc/cpu/alignment (~4h of uptime): > System: 22304815 (btrfs_get_token_64+0x13c/0x148 [btrfs]) For example, when compiling the kernel on a btrfs volume the counter increases by 100...1000 per second. The function shown "btrfs_get_token_64()" is defined here: > http://lxr.free-electrons.com/source/fs/btrfs/struct-funcs.c#L53 =2E..it already uses get_unaligned_leXX accessors. Quoting a comment in arch/arm/mm/alignment.c: * ARMv6 and later CPUs can perform unaligned accesses for * most single load and store instructions up to word size. * LDM, STM, LDRD and STRD still need to be handled. But on a 32bit ARMv7 64bits are not word-sized. Is the exception and fixup overhead neglectable? Do we have to introduce something like HAVE_EFFICIENT_UNALIGNED_64BIT_ACCESS? regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | --Mq2kAvwp7uq3S49hWvEFtFFlKcRfUMj4s-- --XAmoMxp5D1p7tHvSwJQotb3WdgDS1E9gB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJW2LfyAAoJED07qiWsqSVqd/UH/1wVF00gJBpPQ8rZfmJwFy2d Qj+L9TnQD4ZCJkLKcXDaUDD/z2nvlIFuPndfB6p1USkpMcwMriCzMtA05R/wGjn5 pmLfiWR7NVCmEpwsAp+8fVElRrcmzEEHLGdXKunvK1nqYZGScj7dh8GpK4CpWRPk 3WNjO4d3pY6RAoAkZYkP78bjaeAc9ruo/FXbHELe4aPLFbc/tQroVcrHr3VBfl2P 8M3IxTz1A2rqXtjzYBfdH2dOMtpGA66CdbnQy4OR534col0iz601u7BPjaoPd1Y1 fqEPUDhmA/PMelmJuqg+0WSntZjAzqmJt3z4+Ozz8mcuCvoeviSdnzg7cPOCR0s= =HWH4 -----END PGP SIGNATURE----- --XAmoMxp5D1p7tHvSwJQotb3WdgDS1E9gB--