Skip to contentSkip to conversation

sched: remove duplicated tick_nohz_full_enabled() check

PATCH Applied linmiaohe 3 participants 3 messages Jul 28, 2020 – Jul 31, 2020 Scheduler

lore
Share & tools
lore

linmiaohe

author
#0 lore raw

PATCH 1/1 sched: remove duplicated tick_nohz_full_enabled() check

From: Miaohe Lin <[email protected]>

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

---
 kernel/sched/sched.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
kernel/sched/sched.h +1 -6
index 877fb08eb1b0..02028f785f87 100644
@@ -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;
Signature · 1 line
2.19.1
merge bot Applied
#1 lore raw

[tip: sched/core] sched: Remove duplicated tick_nohz_full_enabled() check

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

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 <[email protected]>
AuthorDate:    Tue, 28 Jul 2020 19:17:55 +08:00
Committer:     Ingo Molnar <[email protected]>
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. ]

---
 kernel/sched/sched.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
kernel/sched/sched.h +1 -6
index 9f33c77..296efd3 100644
@@ -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;
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to linmiaohe
Quoted 4 lines · On Tue, 28 Jul 2020 19:17:55 +0800 linmiaohe <[email protected]> wrote:

From: Miaohe Lin <[email protected]>

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.

-- Steve

Quoted 24 lines
---
 kernel/sched/sched.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
kernel/sched/sched.h +1 -6
index 877fb08eb1b0..02028f785f87 100644
@@ -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;