All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: "Wangshaobo (bobo)" <bobo.shaobowang@huawei.com>
Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com,
	lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, mhiramat@kernel.org,
	ndesaulniers@google.com, ojeda@kernel.org, peterz@infradead.org,
	rafael.j.wysocki@intel.com, revest@chromium.org,
	robert.moore@intel.com, rostedt@goodmis.org, will@kernel.org,
	"liwei (GF)" <liwei391@huawei.com>
Subject: Re: [PATCH v3 1/8] ftrace: Add DYNAMIC_FTRACE_WITH_CALL_OPS
Date: Mon, 6 Feb 2023 09:28:09 +0000	[thread overview]
Message-ID: <Y+DIKQvfYE15QL3F@FVFF77S0Q05N> (raw)
In-Reply-To: <60ec7607-7c5c-1a6e-18c9-8025cb2f289f@huawei.com>

On Tue, Jan 31, 2023 at 09:25:51AM +0800, Wangshaobo (bobo) wrote:
> 在 2023/1/30 18:25, Mark Rutland 写道:
> > On Sat, Jan 28, 2023 at 04:46:48PM +0800, Wangshaobo (bobo) wrote:
> > > 锟斤拷 2023/1/23 21:45, Mark Rutland 写锟斤拷:
> > > > +config DYNAMIC_FTRACE_WITH_CALL_OPS
> > > > +	def_bool y
> > > > +	depends on HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
> > > > +
> > > Hi Mark,
> > 
> > Hi,
> > 
> > > I have test your patches and it looks fine with my sample module,
> > 
> > Thanks for testing!
> > 
> > > but here setting DYNAMIC_FTRACE_WITH_CALL_OPS to y immutably may increase the
> > > .text section size by 5% or more, how about making this to optional^^
> > 
> > We could consider making this optional. I had not made this optional so far as
> > in the future I'd like to make this the only implementation of ftrace on arm64
> > (once we can drop the old mcount version, and once we've sorted out the
> > incompatibility with CFI). In the mean time, it probably makes sense to have
> > the option at least to enable testing of each of the two forms.
> > 
> > Is your concern that the overall kernel image size is larger, or do you care
> > specifically about the size of the .text section for some reason?
> > 
> > Thanks,
> > Mark
> Embedded devices may pay more attention to Image size, and which may also
> indirectly affects performance, for more reason,

I appreciate those concerns, however:

a) For the Image size, the mcount_loc table and associated relocations already
   imposes a much greater penalty. So I'd expect that where the size truly
   matters, ftrace would be completely disabled anyway.

   I'm currently looking at shrinking the mcount_loc table (and removing the
   need for relocationgs), which should save much more space.

b) For performance, without data this is supposition. Everything so far
   indicates that there is not a measureable performance difference, and from
   other threads it's possible that the increased function alignment *aids*
   performance.

   If you have data to the contrary, I'm happy to investigate.

> I think making sense to have the option for testing is more important.

As above, I'm happy to add an option for functional testing of the ftrace
implementation, but I don't think that it's a good idea to use that as a size
or performance tweak.

Thanks,
Mark.

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: "Wangshaobo (bobo)" <bobo.shaobowang@huawei.com>
Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com,
	lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, mhiramat@kernel.org,
	ndesaulniers@google.com, ojeda@kernel.org, peterz@infradead.org,
	rafael.j.wysocki@intel.com, revest@chromium.org,
	robert.moore@intel.com, rostedt@goodmis.org, will@kernel.org,
	"liwei (GF)" <liwei391@huawei.com>
Subject: Re: [PATCH v3 1/8] ftrace: Add DYNAMIC_FTRACE_WITH_CALL_OPS
Date: Mon, 6 Feb 2023 09:28:09 +0000	[thread overview]
Message-ID: <Y+DIKQvfYE15QL3F@FVFF77S0Q05N> (raw)
In-Reply-To: <60ec7607-7c5c-1a6e-18c9-8025cb2f289f@huawei.com>

On Tue, Jan 31, 2023 at 09:25:51AM +0800, Wangshaobo (bobo) wrote:
> 在 2023/1/30 18:25, Mark Rutland 写道:
> > On Sat, Jan 28, 2023 at 04:46:48PM +0800, Wangshaobo (bobo) wrote:
> > > 锟斤拷 2023/1/23 21:45, Mark Rutland 写锟斤拷:
> > > > +config DYNAMIC_FTRACE_WITH_CALL_OPS
> > > > +	def_bool y
> > > > +	depends on HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
> > > > +
> > > Hi Mark,
> > 
> > Hi,
> > 
> > > I have test your patches and it looks fine with my sample module,
> > 
> > Thanks for testing!
> > 
> > > but here setting DYNAMIC_FTRACE_WITH_CALL_OPS to y immutably may increase the
> > > .text section size by 5% or more, how about making this to optional^^
> > 
> > We could consider making this optional. I had not made this optional so far as
> > in the future I'd like to make this the only implementation of ftrace on arm64
> > (once we can drop the old mcount version, and once we've sorted out the
> > incompatibility with CFI). In the mean time, it probably makes sense to have
> > the option at least to enable testing of each of the two forms.
> > 
> > Is your concern that the overall kernel image size is larger, or do you care
> > specifically about the size of the .text section for some reason?
> > 
> > Thanks,
> > Mark
> Embedded devices may pay more attention to Image size, and which may also
> indirectly affects performance, for more reason,

I appreciate those concerns, however:

a) For the Image size, the mcount_loc table and associated relocations already
   imposes a much greater penalty. So I'd expect that where the size truly
   matters, ftrace would be completely disabled anyway.

   I'm currently looking at shrinking the mcount_loc table (and removing the
   need for relocationgs), which should save much more space.

b) For performance, without data this is supposition. Everything so far
   indicates that there is not a measureable performance difference, and from
   other threads it's possible that the increased function alignment *aids*
   performance.

   If you have data to the contrary, I'm happy to investigate.

> I think making sense to have the option for testing is more important.

As above, I'm happy to add an option for functional testing of the ftrace
implementation, but I don't think that it's a good idea to use that as a size
or performance tweak.

Thanks,
Mark.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-02-06  9:28 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 13:45 [PATCH v3 0/8] arm64/ftrace: Add support for DYNAMIC_FTRACE_WITH_CALL_OPS Mark Rutland
2023-01-23 13:45 ` Mark Rutland
2023-01-23 13:45 ` [PATCH v3 1/8] ftrace: Add DYNAMIC_FTRACE_WITH_CALL_OPS Mark Rutland
2023-01-23 13:45   ` Mark Rutland
2023-01-28  8:46   ` Wangshaobo (bobo)
2023-01-28  8:46     ` Wangshaobo (bobo)
2023-01-30 10:25     ` Mark Rutland
2023-01-30 10:25       ` Mark Rutland
2023-01-31  1:25       ` Wangshaobo (bobo)
2023-01-31  1:25         ` Wangshaobo (bobo)
2023-02-06  9:28         ` Mark Rutland [this message]
2023-02-06  9:28           ` Mark Rutland
2023-01-23 13:45 ` [PATCH v3 2/8] Compiler attributes: GCC cold function alignment workarounds Mark Rutland
2023-01-23 13:45   ` Mark Rutland
2023-01-23 13:45 ` [PATCH v3 3/8] ACPI: Don't build ACPICA with '-Os' Mark Rutland
2023-01-23 13:45   ` Mark Rutland
2023-01-23 13:45 ` [PATCH v3 4/8] arm64: Extend support for CONFIG_FUNCTION_ALIGNMENT Mark Rutland
2023-01-23 13:45   ` Mark Rutland
2023-01-23 13:46 ` [PATCH v3 5/8] arm64: insn: Add helpers for BTI Mark Rutland
2023-01-23 13:46   ` Mark Rutland
2023-01-23 13:46 ` [PATCH v3 6/8] arm64: patching: Add aarch64_insn_write_literal_u64() Mark Rutland
2023-01-23 13:46   ` Mark Rutland
2023-01-23 13:46 ` [PATCH v3 7/8] arm64: ftrace: Update stale comment Mark Rutland
2023-01-23 13:46   ` Mark Rutland
2023-01-23 13:46 ` [PATCH v3 8/8] arm64: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS Mark Rutland
2023-01-23 13:46   ` Mark Rutland
2023-01-23 14:40 ` [PATCH v3 0/8] arm64/ftrace: Add support for DYNAMIC_FTRACE_WITH_CALL_OPS Catalin Marinas
2023-01-23 14:40   ` Catalin Marinas
2023-01-23 22:49   ` Steven Rostedt
2023-01-23 22:49     ` Steven Rostedt
2023-01-23 23:00     ` Steven Rostedt
2023-01-23 23:00       ` Steven Rostedt
2023-01-24 12:10 ` Catalin Marinas
2023-01-24 12:10   ` Catalin Marinas
2023-02-23  9:28 ` Chen-Yu Tsai
2023-02-23  9:28   ` Chen-Yu Tsai

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=Y+DIKQvfYE15QL3F@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=bobo.shaobowang@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwei391@huawei.com \
    --cc=mhiramat@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=revest@chromium.org \
    --cc=robert.moore@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=will@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.