Skip to contentSkip to conversation

sched/fair: move nohz definition to where it's used

PATCH In review Chengming Zhou 2 participants 3 messages Jun 23, 2022 – Jul 5, 2022 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: move nohz definition to where it's used

The nohz definition is too far from where it's used, just move it to the right place. No functional change.

---
 kernel/sched/fair.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)
kernel/sched/fair.c +8 -13
index 8bed75757e65..01f7047c41d7 100644
@@ -5842,19 +5842,6 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
 DEFINE_PER_CPU(cpumask_var_t, load_balance_mask);
 DEFINE_PER_CPU(cpumask_var_t, select_idle_mask);
 
-#ifdef CONFIG_NO_HZ_COMMON
-
-static struct {
-	cpumask_var_t idle_cpus_mask;
-	atomic_t nr_cpus;
-	int has_blocked;		/* Idle CPUS has blocked load */
-	int needs_update;		/* Newly idle CPUs need their next_balance collated */
-	unsigned long next_balance;     /* in jiffy units */
-	unsigned long next_blocked;	/* Next update of blocked load in jiffies */
-} nohz ____cacheline_aligned;
-
-#endif /* CONFIG_NO_HZ_COMMON */
-
 static unsigned long cpu_load(struct rq *rq)
 {
 	return cfs_rq_load_avg(&rq->cfs);
@@ -10374,6 +10361,14 @@ static inline int on_null_domain(struct rq *rq)
  * - HK_TYPE_MISC CPUs are used for this task, because HK_TYPE_SCHED not set
  *   anywhere yet.
  */
+static struct {
+	cpumask_var_t idle_cpus_mask;
+	atomic_t nr_cpus;
+	int has_blocked;		/* Idle CPUS has blocked load */
+	int needs_update;		/* Newly idle CPUs need their next_balance collated */
+	unsigned long next_balance;     /* in jiffy units */
+	unsigned long next_blocked;	/* Next update of blocked load in jiffies */
+} nohz ____cacheline_aligned;
 
 static inline int find_new_ilb(void)
 {
Signature · 1 line
2.36.1
#1 lore raw
Quoted 4 lines · Chengming Zhou

The nohz definition is too far from where it's used, just move it to the right place. No functional change.

Standalone cosmetic changes are very unlikely to get anywhere, I'd suggest bundling this with some other non-cosmetic patches hitting the area.

#2 lore raw
Quoted 9 lines · Valentin Schneider
Quoted 4 lines · Chengming Zhou

The nohz definition is too far from where it's used, just move it to the right place. No functional change.

Standalone cosmetic changes are very unlikely to get anywhere, I'd suggest bundling this with some other non-cosmetic patches hitting the area.

Right, make sense, just minor grumble when review the code, sorry for noise.

Thanks.