Skip to contentSkip to conversation

kernel/sched_fair.c: the comment of the calc_delta_fair() maybe not correctly

PATCH In review figo.zhang 3 participants 4 messages Apr 7, 2009 – Apr 8, 2009

lore
Share & tools
lore

figo.zhang

author
#0 lore raw

PATCH 1/1 kernel/sched_fair.c: the comment of the calc_delta_fair() maybe not correctly

the comment of the calc_delta_fair() maybe not correctly, should be delta *= NICE_O_LOAD/se->load

kernel/sched_fair.c +0 -0
index 3816f21..5134b45 100644
@@ -386,7 +386,7 @@ int sched_nr_latency_handler(struct ctl_table

*table, int write, #endif

/*
- * delta /= w
+ * delta *= NICE_O_LOAD/se->load
*/
static inline unsigned long calc_delta_fair(unsigned long delta, struct sched_entity *se)

#1 lore raw
Quoted 4 lines · figo.zhang

the comment of the calc_delta_fair() maybe not correctly, should be delta *= NICE_O_LOAD/se->load

Agreed.

But...

kernel/sched_fair.c int sched_nr_latency_handler(struct ctl_table · line 389

Quoted 11 lines
kernel/sched_fair.c +1 -1
index 3816f21..5134b45 100644
@@ -386,7 +386,7 @@ int sched_nr_latency_handler(struct ctl_table
 *table, int write, #endif
 
 /*
- * delta /= w
+ * delta *= NICE_O_LOAD/se->load

Is that an 'O' or '0'(zero)? It looks like an 'O' for me ... Obviously, it should be '0' (zero). :)

Quoted 8 lines
kernel/sched_fair.c +0 -0
 */

static inline unsigned long
calc_delta_fair(unsigned long delta, struct sched_entity *se) --
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 1 line
Do what you love, f**k the rest! F**k the regulations!
author
#2 lore raw

the comment of the calc_delta_fair() maybe not correctly, should be delta *= NICE_0_LOAD/se->load

kernel/sched_fair.c +0 -0
index 3816f21..5134b45 100644
@@ -386,7 +386,7 @@ int sched_nr_latency_handler(struct ctl_table

*table, int write, #endif

/*
- * delta /= w
+ * delta *= NICE_0_LOAD/se->load
*/
static inline unsigned long calc_delta_fair(unsigned long delta, struct sched_entity *se)

Wed, 8 Apr 2009 00:57:36 +0800
Américo Wang <[email protected]> :

Quoted 36 lines · figo.zhang
Quoted 4 lines

the comment of the calc_delta_fair() maybe not correctly, should be delta *= NICE_O_LOAD/se->load

Agreed.

But...

kernel/sched_fair.c int sched_nr_latency_handler(struct ctl_table · line 389

Quoted 11 lines
kernel/sched_fair.c +1 -1
index 3816f21..5134b45 100644
@@ -386,7 +386,7 @@ int sched_nr_latency_handler(struct ctl_table
 *table, int write, #endif
 
 /*
- * delta /= w
+ * delta *= NICE_O_LOAD/se->load

Is that an 'O' or '0'(zero)? It looks like an 'O' for me ... Obviously, it should be '0' (zero). :)

Quoted 8 lines
kernel/sched_fair.c +0 -0
 */

static inline unsigned long
calc_delta_fair(unsigned long delta, struct sched_entity *se) --
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw
Quoted 10 lines · figo.zhang

the comment of the calc_delta_fair() maybe not correctly, should be delta *= NICE_0_LOAD/se->load

kernel/sched_fair.c +0 -0
index 3816f21..5134b45 100644

kernel/sched_fair.c int sched_nr_latency_handler(struct ctl_table · line 392

Quoted 8 lines
kernel/sched_fair.c +1 -1
@@ -386,7 +386,7 @@ int sched_nr_latency_handler(struct ctl_table
 *table, int write, #endif
 
 /*
- * delta /= w
+ * delta *= NICE_0_LOAD/se->load
  */
 static inline unsigned long
 calc_delta_fair(unsigned long delta, struct sched_entity *se)

The comment is conceptually correct.

NICE_0_LOAD := 1 and se->load := w, ergo, delta /= w.