mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>, X86 ML <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	"Naveen N . Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	Miroslav Benes <mbenes@suse.cz>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [RFC][PATCH] ftrace,objtool: PC32 based __mcount_loc
Date: Thu, 23 Jun 2022 15:19:59 +0100	[thread overview]
Message-ID: <YrR2j74IWiGrUKFr@FVFF77S0Q05N.cambridge.arm.com> (raw)
In-Reply-To: <CAMj1kXFuPAUfknadWDXPDXA5LYFnr0MGeXvF5MAYJBLxfCWEWw@mail.gmail.com>

On Tue, Jun 21, 2022 at 06:27:39PM +0200, Ard Biesheuvel wrote:
> On Fri, 17 Jun 2022 at 13:40, Mark Rutland <mark.rutland@arm.com> wrote:
> >
> > On Fri, Jun 17, 2022 at 01:24:53PM +0200, Peter Zijlstra wrote:
> > >
> > > Hi,
> > >
> > > I recently noticed that __mcount_loc is 64bit wide, containing absolute
> > > addresses. Since __mcount_loc is a permanent section (not one we drop
> > > after boot), this bloats the kernel memory usage for no real purpose.
> > >
> > > The below patch adds __mcount_loc_32 and objtool support to generate it.
> > > This saves, on an x86_64-defconfig + FTRACE, 23975*4 ~= 94K of permanent
> > > storage.
> >
> > We have a similar issue on arm64, which is exacerbated by needing ABS64
> > relocations (24 bytes per entry!) adding significant bloat when FTRACE is
> > enabled.
> >
> > It'd be really nice if going forwards compilers could expose an option to
> > generate PC32/PREL32 entries directly for this.
> 
> As opposed to generating absolute references today? Or as opposed to
> having to rely on our own tooling?

Both; My prefrence would be the compiler had the option to generate these
entries as relative at compile-time, without needing a binary post-processing
step.

That said, from my PoV this is one of the things that I think it's somewhat
reasonable for objtool to do, as it's arguably akin to the build-time sort, and
doesn't require deep knowledge of the control flow, etc.

Thanks,
Mark.

  reply	other threads:[~2022-06-23 14:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 11:24 Peter Zijlstra
2022-06-17 11:40 ` Mark Rutland
2022-06-21 16:27   ` Ard Biesheuvel
2022-06-23 14:19     ` Mark Rutland [this message]
2022-06-22 14:54   ` Steven Rostedt
2022-06-23 14:21     ` Mark Rutland
2022-06-24  0:01       ` Steven Rostedt
2022-06-17 11:44 ` Christophe Leroy
2022-06-17 12:06   ` Peter Zijlstra
2022-06-17 20:11 ` Josh Poimboeuf
2022-06-20  7:35   ` Peter Zijlstra
2022-06-20  7:42     ` Christophe Leroy
2022-06-22 14:50 ` Steven Rostedt
2022-06-24  7:16   ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YrR2j74IWiGrUKFr@FVFF77S0Q05N.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=ardb@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=nathan@kernel.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®