linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: remove duplicated tick_nohz_full_enabled() check
@ 2020-07-28 11:17 linmiaohe
  2020-07-28 12:29 ` [tip: sched/core] sched: Remove " tip-bot2 for Miaohe Lin
  2020-07-31  2:51 ` [PATCH] sched: remove " Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: linmiaohe @ 2020-07-28 11:17 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman
  Cc: linux-kernel, linmiaohe

From: Miaohe Lin <linmiaohe@huawei.com>

The func tick_nohz_full_enabled() is also called by tick_nohz_full_cpu().
So this one is duplicated and should be removed.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 kernel/sched/sched.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 877fb08eb1b0..02028f785f87 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1930,12 +1930,7 @@ extern int __init sched_tick_offload_init(void);
  */
 static inline void sched_update_tick_dependency(struct rq *rq)
 {
-	int cpu;
-
-	if (!tick_nohz_full_enabled())
-		return;
-
-	cpu = cpu_of(rq);
+	int cpu = cpu_of(rq);
 
 	if (!tick_nohz_full_cpu(cpu))
 		return;
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip: sched/core] sched: Remove duplicated tick_nohz_full_enabled() check
  2020-07-28 11:17 [PATCH] sched: remove duplicated tick_nohz_full_enabled() check linmiaohe
@ 2020-07-28 12:29 ` tip-bot2 for Miaohe Lin
  2020-07-31  2:51 ` [PATCH] sched: remove " Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Miaohe Lin @ 2020-07-28 12:29 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Miaohe Lin, Ingo Molnar, x86, LKML

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     21a6ee14a8f277766618ef07154432b46528113e
Gitweb:        https://git.kernel.org/tip/21a6ee14a8f277766618ef07154432b46528113e
Author:        Miaohe Lin <linmiaohe@huawei.com>
AuthorDate:    Tue, 28 Jul 2020 19:17:55 +08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 28 Jul 2020 13:27:54 +02:00

sched: Remove duplicated tick_nohz_full_enabled() check

In sched_update_tick_dependency() there's two calls that check
whether nohz_full is enabled: tick_nohz_full_cpu() does it
implicitly, while there's also an explicit call to tick_nohz_full_enabled().

Remove the duplicated, open coded check.

[ mingo: Amended the changelog. ]

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/1595935075-14223-1-git-send-email-linmiaohe@huawei.com
---
 kernel/sched/sched.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 9f33c77..296efd3 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1961,12 +1961,7 @@ extern int __init sched_tick_offload_init(void);
  */
 static inline void sched_update_tick_dependency(struct rq *rq)
 {
-	int cpu;
-
-	if (!tick_nohz_full_enabled())
-		return;
-
-	cpu = cpu_of(rq);
+	int cpu = cpu_of(rq);
 
 	if (!tick_nohz_full_cpu(cpu))
 		return;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched: remove duplicated tick_nohz_full_enabled() check
  2020-07-28 11:17 [PATCH] sched: remove duplicated tick_nohz_full_enabled() check linmiaohe
  2020-07-28 12:29 ` [tip: sched/core] sched: Remove " tip-bot2 for Miaohe Lin
@ 2020-07-31  2:51 ` Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2020-07-31  2:51 UTC (permalink / raw)
  To: linmiaohe
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	bsegall, mgorman, linux-kernel

On Tue, 28 Jul 2020 19:17:55 +0800
linmiaohe <linmiaohe@huawei.com> wrote:

> From: Miaohe Lin <linmiaohe@huawei.com>
> 
> The func tick_nohz_full_enabled() is also called by tick_nohz_full_cpu().
> So this one is duplicated and should be removed.

Seems reasonable.

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  kernel/sched/sched.h | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 877fb08eb1b0..02028f785f87 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -1930,12 +1930,7 @@ extern int __init sched_tick_offload_init(void);
>   */
>  static inline void sched_update_tick_dependency(struct rq *rq)
>  {
> -	int cpu;
> -
> -	if (!tick_nohz_full_enabled())
> -		return;
> -
> -	cpu = cpu_of(rq);
> +	int cpu = cpu_of(rq);
>  
>  	if (!tick_nohz_full_cpu(cpu))
>  		return;


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-31  2:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28 11:17 [PATCH] sched: remove duplicated tick_nohz_full_enabled() check linmiaohe
2020-07-28 12:29 ` [tip: sched/core] sched: Remove " tip-bot2 for Miaohe Lin
2020-07-31  2:51 ` [PATCH] sched: remove " Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).