Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7356629imm; Thu, 28 Jun 2018 02:18:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdViWCruYOj1SLjRCbK3/eoiJxecH2283a3fDbSp2ezxcUpfG9We8yGXOCi9U63nLEioOsf X-Received: by 2002:a65:618c:: with SMTP id c12-v6mr6208561pgv.411.1530177519707; Thu, 28 Jun 2018 02:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530177519; cv=none; d=google.com; s=arc-20160816; b=vrRx0M0PrV+RSzBE5yuCXJay4dhTzgFJs/rk/BXAm6X55/Owf3LHQyV8h+Pp/9Dijn 0pt3+HnmP0V/1qck02xlgyt/8AFbSKFsPnZxZTHxRZKTp5UTTaOMWshITBjFl2Q7XaX6 +AV9+abjD/FCQzmjuvqDKX17sTH76s43ksDQl0ih3hy1AO+A/q1TfD1uldBt9dHjQdtR WfniPPvF+253ZfQrQbCka0EAT1dZn3Beetw0roim4ijzPCU+B+5wGGlb6p75qbkUXkp8 K0wEChsoefk7lRPITTdigN6MJSg6m4efCULEtaguyNITyWXCO/hE/Xdyads6nspjwek6 /rpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ArfIoDnZRubDYi2Ubnz6wM0yeCEkUvXjOH+MRrfznX4=; b=jfX86YWpLSRzGftFUJdxiyM3LygcIcQQJKagBt4ttx7kq+nHOP7dE9GrhoQg+gyNKZ OiZUa3UZSSDiNxBSlq82d1goFABwpYa3J1O/mGE6ld/OEQo8Mp4AjrE3oEnHd3/nRoNl AvayB7zruK15R4XE87bEpu0wEqqFF2kleBL0xPZjqysUVbYXtKPZ4DgDn/Zh0/q6sPqM 3X1jpnfWGJp4i4W0Hp+tUu4OglrWwJz0HhSdC8V0zlhwJQInVbWrqazbcSGllKe6cX6K YHtm+d55lYjdDiTzC76yBQU+fwDA5C8GQp42wYRGaNuYOdT+ypSLN/Jczn+K0lcZQBUe t2qg== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3-v6si6258121plb.394.2018.06.28.02.18.22; Thu, 28 Jun 2018 02:18:39 -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; 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 S935031AbeF1JRV (ORCPT + 99 others); Thu, 28 Jun 2018 05:17:21 -0400 Received: from foss.arm.com ([217.140.101.70]:43472 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934758AbeF1JRU (ORCPT ); Thu, 28 Jun 2018 05:17:20 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B2FA180D; Thu, 28 Jun 2018 02:17:19 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8135C3F266; Thu, 28 Jun 2018 02:17:19 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 947EF1AE4DED; Thu, 28 Jun 2018 10:17:57 +0100 (BST) Date: Thu, 28 Jun 2018 10:17:57 +0100 From: Will Deacon To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, Catalin Marinas , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , Steven Rostedt , Peter Zijlstra Subject: Re: [PATCH 3/5] arm64/kernel: jump_label: switch to relative references Message-ID: <20180628091757.GA10751@arm.com> References: <20180627160604.8154-1-ard.biesheuvel@linaro.org> <20180627160604.8154-4-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180627160604.8154-4-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 27, 2018 at 06:06:02PM +0200, Ard Biesheuvel wrote: > On a randomly chosen distro kernel build for arm64, vmlinux.o shows the > following sections, containing jump label entries, and the associated > RELA relocation records, respectively: > > ... > [38088] __jump_table PROGBITS 0000000000000000 00e19f30 > 000000000002ea10 0000000000000000 WA 0 0 8 > [38089] .rela__jump_table RELA 0000000000000000 01fd8bb0 > 000000000008be30 0000000000000018 I 38178 38088 8 > ... > > In other words, we have 190 KB worth of 'struct jump_entry' instances, > and 573 KB worth of RELA entries to relocate each entry's code, target > and key members. This means the RELA section occupies 10% of the .init > segment, and the two sections combined represent 5% of vmlinux's entire > memory footprint. > > So let's switch from 64-bit absolute references to 32-bit relative > references: this reduces the size of the __jump_table by 50%, and gets > rid of the RELA section entirely. > > Signed-off-by: Ard Biesheuvel > --- > arch/arm64/Kconfig | 1 + > arch/arm64/include/asm/jump_label.h | 16 ++++------------ > arch/arm64/kernel/jump_label.c | 6 +++--- > 3 files changed, 8 insertions(+), 15 deletions(-) Looks good, cheers: Acked-by: Will Deacon Will