Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62975C27C76 for ; Wed, 25 Jan 2023 11:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sSKhJQZeyT8S8I680cWvJ0DQo3avlrTj76dpyPJndTY=; b=OSRT+qeClgXlKn SQBwOkVUS1J0p3wcLJ7jt/j2wp8v6VD5PDRyc0/dhaiCE0TdInIjEXjtPJPyccSpmW28pSjIxOh1h g5Ma4YJ8W2+yLFBcj9+/kqbwLFp4d48p1CTcfiU89r+wol06vSJCOzPVURVVn/OOzMXK1zH+2chJa wiCPZfGEoAIGNfJwJVYle+dMgqTkgx9hxNo1QrTZC+6ziA4A0QepDmTZkMinxhYRCLaWoxzFkzzEU YNmTSUtZ7NcGwy5JUExoISNhB++I1NSP9DZOzuo/UmsBumxFYeBpDotzhYlwDRdm86GXhWJk71kIQ mH2XDvxPdJ7e1e8IrGfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKdlY-007729-52; Wed, 25 Jan 2023 11:16:32 +0000 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKdlU-0076z3-D6 for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2023 11:16:30 +0000 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-187-rcURqmcMPseQZXBBvv05JA-1; Wed, 25 Jan 2023 11:16:21 +0000 X-MC-Unique: rcURqmcMPseQZXBBvv05JA-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.45; Wed, 25 Jan 2023 11:16:19 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.045; Wed, 25 Jan 2023 11:16:19 +0000 From: David Laight To: 'Will Deacon' , Mina Almasry CC: Catalin Marinas , Peter Zijlstra , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v1] arch: Enable function alignment for arm64 Thread-Topic: [PATCH v1] arch: Enable function alignment for arm64 Thread-Index: AQHZL+y0RRcMkmENukGyDrKLrCNKda6u+djA Date: Wed, 25 Jan 2023 11:16:19 +0000 Message-ID: References: <20221208053649.540891-1-almasrymina@google.com> <20230124120913.GA26449@willie-the-truck> In-Reply-To: <20230124120913.GA26449@willie-the-truck> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230125_031628_728299_AB79A6AC X-CRM114-Status: GOOD ( 17.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Will Deacon > Sent: 24 January 2023 12:09 > > On Wed, Dec 07, 2022 at 09:36:48PM -0800, Mina Almasry wrote: > > We recently ran into a double-digit percentage hackbench regression > > when backporting commit 12df140f0bdf ("mm,hugetlb: take hugetlb_lock > > before decrementing h->resv_huge_pages") to an older kernel. This was > > surprising since hackbench does use hugetlb pages at all and the > > modified code is not invoked. After some debugging we found that the > > regression can be fixed by back-porting commit d49a0626216b ("arch: > > Introduce CONFIG_FUNCTION_ALIGNMENT") and enabling function alignment > > for arm64. I suggest enabling it by default for arm64 if possible. > > ... > > This increases the size of .text for a defconfig build by ~2%, so I think it > would be nice to have some real numbers for the performance uplift. Are you > able to elaborate beyond "double-digit percentage hackbench regression"? > > In general, however, I'm supportive of the patch (and it seems that x86 > does the same thing) so: I bet it just changes the alignment of the code so that more functions are using different cache lines. All sorts of other random changes are likely to have a similar effect. Cache-line aligning the start of a function probably reduces the number of cache lines the functions needs - but that isn't guaranteed. It also slightly reduces the delay on a cache miss - but they are so slow it probably makes almost no difference. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel