From: Steven Rostedt <rostedt@goodmis.org>
To: Li kunyu <kunyu@nfschina.com>
Cc: mingo@redhat.com, linux@armlinux.org.uk,
paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, hca@linux.ibm.com, gor@linux.ibm.com,
agordeev@linux.ibm.com, borntraeger@linux.ibm.com,
svens@linux.ibm.com, tglx@linutronix.de, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-s390@vger.kernel.org
Subject: Re: [PATCH] kernel: Ftrace seems to have functions to improve performance through optimization
Date: Thu, 12 May 2022 10:12:29 -0400 [thread overview]
Message-ID: <20220512101229.7886a798@gandalf.local.home> (raw)
In-Reply-To: <20220512063017.57412-1-kunyu@nfschina.com>
On Thu, 12 May 2022 14:30:17 +0800
Li kunyu <kunyu@nfschina.com> wrote:
> At present, it is found that two functions could be optimized, and the
> performance may be improved.
"may be impoved"?
Have any numbers? This changes a very slow path. I do not think it is worth
it for the "optimized". Also it's a weak function. An arch may be added that
wants to return a value.
>
> Signed-off-by: Li kunyu <kunyu@nfschina.com>
> ---
> void ftrace_modify_all_code(int command)
> @@ -2804,12 +2802,7 @@ void __weak arch_ftrace_update_code(int command)
>
> static void ftrace_run_update_code(int command)
> {
> - int ret;
> -
> - ret = ftrace_arch_code_modify_prepare();
> - FTRACE_WARN_ON(ret);
Currently no arch returns anything but zero, but this was added in case
something wrong did happen, and the FTRACE_WARN_ON() is more than just a
WARN_ON(). It will also disable ftrace.
Now, I'm not totally against this change, but not for the rationale in the
change log. That is, there is no optimization here. But as a standard clean
up with something like "There is currently no version of
ftrace_arch_code_modify_prepare() that returns anything bug zero, so the
check is not needed" is a more appropriate reason for this change.
-- Steve
> - if (ret)
> - return;
> + ftrace_arch_code_modify_prepare();
>
> /*
> * By default we use stop_machine() to modify the code.
> @@ -2819,8 +2812,7 @@ static void ftrace_run_update_code(int command)
> */
> arch_ftrace_update_code(command);
>
> - ret = ftrace_arch_code_modify_post_process();
> - FTRACE_WARN_ON(ret);
> + ftrace_arch_code_modify_post_process();
> }
>
> static void ftrace_run_modify_code(struct ftrace_ops *ops, int command,
next prev parent reply other threads:[~2022-05-12 14:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 6:30 [PATCH] kernel: Ftrace seems to have functions to improve performance through optimization Li kunyu
2022-05-12 14:12 ` Steven Rostedt [this message]
2022-05-12 14:45 ` Li kunyu
2022-05-12 15:07 ` Steven Rostedt
2022-05-12 15:19 ` Li kunyu
2022-05-13 2:13 ` [PATCH] kernel: Ftrace seems to have functions to improve performance through optimization " Li kunyu
2022-05-17 14:13 ` Steven Rostedt
2022-05-18 2:36 ` [PATCH v2] ftrace: Remove return value of ftrace_arch_modify_*() Li kunyu
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=20220512101229.7886a798@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=agordeev@linux.ibm.com \
--cc=aou@eecs.berkeley.edu \
--cc=borntraeger@linux.ibm.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hpa@zytor.com \
--cc=kunyu@nfschina.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mingo@redhat.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=svens@linux.ibm.com \
--cc=tglx@linutronix.de \
--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