From: Steven Rostedt <rostedt@goodmis.org>
To: Aili Yao <yaoaili126@gmail.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
bsegall@google.com, mgorman@suse.de,
linux-kernel@vger.kernel.org, yaoaili@kingsoft.com
Subject: Re: [PATCH] sched/isolation: delete redundant housekeeping_overridden check
Date: Wed, 24 Nov 2021 09:13:16 -0500 [thread overview]
Message-ID: <20211124091316.5259d22f@gandalf.local.home> (raw)
In-Reply-To: <20211124154214.43972a31@gmail.com>
On Wed, 24 Nov 2021 15:42:14 +0800
Aili Yao <yaoaili126@gmail.com> wrote:
> Signed-off-by: Aili Yao <yaoaili@kingsoft.com>
> ---
> include/linux/sched/isolation.h | 9 ++-------
> kernel/sched/isolation.c | 4 ++--
> 2 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
> index cc9f393e2a70..3ccc19e52186 100644
> --- a/include/linux/sched/isolation.h
> +++ b/include/linux/sched/isolation.h
> @@ -23,9 +23,8 @@ extern int housekeeping_any_cpu(enum hk_flags flags);
> extern const struct cpumask *housekeeping_cpumask(enum hk_flags flags);
> extern bool housekeeping_enabled(enum hk_flags flags);
> extern void housekeeping_affine(struct task_struct *t, enum hk_flags flags);
> -extern bool housekeeping_test_cpu(int cpu, enum hk_flags flags);
> +extern bool housekeeping_cpu(int cpu, enum hk_flags flags);
Now you added an unneeded function call (which is also expensive).
There's a reason the static_branch was inlined.
-- Steve
> extern void __init housekeeping_init(void);
> -
> #else
>
> static inline int housekeeping_any_cpu(enum hk_flags flags)
> @@ -46,15 +45,11 @@ static inline bool housekeeping_enabled(enum hk_flags flags)
> static inline void housekeeping_affine(struct task_struct *t,
> enum hk_flags flags) { }
> static inline void housekeeping_init(void) { }
> -#endif /* CONFIG_CPU_ISOLATION */
>
> static inline bool housekeeping_cpu(int cpu, enum hk_flags flags)
> {
> -#ifdef CONFIG_CPU_ISOLATION
> - if (static_branch_unlikely(&housekeeping_overridden))
> - return housekeeping_test_cpu(cpu, flags);
> -#endif
> return true;
> }
> +#endif /* CONFIG_CPU_ISOLATION */
>
> #endif /* _LINUX_SCHED_ISOLATION_H */
> diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
> index 7f06eaf12818..b5e81df4b04a 100644
> --- a/kernel/sched/isolation.c
> +++ b/kernel/sched/isolation.c
> @@ -54,14 +54,14 @@ void housekeeping_affine(struct task_struct *t, enum hk_flags flags)
> }
> EXPORT_SYMBOL_GPL(housekeeping_affine);
>
> -bool housekeeping_test_cpu(int cpu, enum hk_flags flags)
> +bool housekeeping_cpu(int cpu, enum hk_flags flags)
> {
> if (static_branch_unlikely(&housekeeping_overridden))
> if (housekeeping_flags & flags)
> return cpumask_test_cpu(cpu, housekeeping_mask);
> return true;
> }
> -EXPORT_SYMBOL_GPL(housekeeping_test_cpu);
> +EXPORT_SYMBOL_GPL(housekeeping_cpu);
prev parent reply other threads:[~2021-11-24 14:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 7:45 Aili Yao
2021-11-23 17:38 ` Steven Rostedt
2021-11-24 1:21 ` Aili Yao
2021-11-24 1:42 ` Steven Rostedt
2021-11-24 7:42 ` Aili Yao
2021-11-24 14:13 ` Steven Rostedt [this message]
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=20211124091316.5259d22f@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.org \
--cc=yaoaili126@gmail.com \
--cc=yaoaili@kingsoft.com \
/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®