diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-11 18:58:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-11 18:58:37 -0400 |
commit | d291676ce8bc1d8ef93488023d04027010596de3 (patch) | |
tree | dc8e30914adf13695f972229728506d10d683eb5 /kernel | |
parent | 3dab307e527f2a9bbb4f9d00240374bb93d1945f (diff) | |
parent | 5167e75f4d2d10bff6afee1f358313e87b4df246 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
sched debug: dont print kernel address in /proc/sched_debug
sched: fix typo in the FAIR_GROUP_SCHED branch
sched: improve rq-clock overflow logic
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 15 | ||||
-rw-r--r-- | kernel/sched_debug.c | 2 | ||||
-rw-r--r-- | kernel/sched_fair.c | 7 |
3 files changed, 17 insertions, 7 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index b0afd8db1396..6247e4a8350f 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -263,6 +263,7 @@ struct rq { | |||
263 | 263 | ||
264 | unsigned int clock_warps, clock_overflows; | 264 | unsigned int clock_warps, clock_overflows; |
265 | unsigned int clock_unstable_events; | 265 | unsigned int clock_unstable_events; |
266 | u64 tick_timestamp; | ||
266 | 267 | ||
267 | atomic_t nr_iowait; | 268 | atomic_t nr_iowait; |
268 | 269 | ||
@@ -341,8 +342,11 @@ static void __update_rq_clock(struct rq *rq) | |||
341 | /* | 342 | /* |
342 | * Catch too large forward jumps too: | 343 | * Catch too large forward jumps too: |
343 | */ | 344 | */ |
344 | if (unlikely(delta > 2*TICK_NSEC)) { | 345 | if (unlikely(clock + delta > rq->tick_timestamp + TICK_NSEC)) { |
345 | clock++; | 346 | if (clock < rq->tick_timestamp + TICK_NSEC) |
347 | clock = rq->tick_timestamp + TICK_NSEC; | ||
348 | else | ||
349 | clock++; | ||
346 | rq->clock_overflows++; | 350 | rq->clock_overflows++; |
347 | } else { | 351 | } else { |
348 | if (unlikely(delta > rq->clock_max_delta)) | 352 | if (unlikely(delta > rq->clock_max_delta)) |
@@ -3308,9 +3312,16 @@ void scheduler_tick(void) | |||
3308 | int cpu = smp_processor_id(); | 3312 | int cpu = smp_processor_id(); |
3309 | struct rq *rq = cpu_rq(cpu); | 3313 | struct rq *rq = cpu_rq(cpu); |
3310 | struct task_struct *curr = rq->curr; | 3314 | struct task_struct *curr = rq->curr; |
3315 | u64 next_tick = rq->tick_timestamp + TICK_NSEC; | ||
3311 | 3316 | ||
3312 | spin_lock(&rq->lock); | 3317 | spin_lock(&rq->lock); |
3313 | __update_rq_clock(rq); | 3318 | __update_rq_clock(rq); |
3319 | /* | ||
3320 | * Let rq->clock advance by at least TICK_NSEC: | ||
3321 | */ | ||
3322 | if (unlikely(rq->clock < next_tick)) | ||
3323 | rq->clock = next_tick; | ||
3324 | rq->tick_timestamp = rq->clock; | ||
3314 | update_cpu_load(rq); | 3325 | update_cpu_load(rq); |
3315 | if (curr != rq->idle) /* FIXME: needed? */ | 3326 | if (curr != rq->idle) /* FIXME: needed? */ |
3316 | curr->sched_class->task_tick(rq, curr); | 3327 | curr->sched_class->task_tick(rq, curr); |
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c index 3da32156394e..87e524762b85 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched_debug.c | |||
@@ -108,7 +108,7 @@ print_cfs_rq_runtime_sum(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
108 | 108 | ||
109 | void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | 109 | void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) |
110 | { | 110 | { |
111 | SEQ_printf(m, "\ncfs_rq %p\n", cfs_rq); | 111 | SEQ_printf(m, "\ncfs_rq\n"); |
112 | 112 | ||
113 | #define P(x) \ | 113 | #define P(x) \ |
114 | SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(cfs_rq->x)) | 114 | SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(cfs_rq->x)) |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index e91db32cadfd..c5af38948a1e 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -959,13 +959,12 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest, | |||
959 | for_each_leaf_cfs_rq(busiest, busy_cfs_rq) { | 959 | for_each_leaf_cfs_rq(busiest, busy_cfs_rq) { |
960 | #ifdef CONFIG_FAIR_GROUP_SCHED | 960 | #ifdef CONFIG_FAIR_GROUP_SCHED |
961 | struct cfs_rq *this_cfs_rq; | 961 | struct cfs_rq *this_cfs_rq; |
962 | long imbalances; | 962 | long imbalance; |
963 | unsigned long maxload; | 963 | unsigned long maxload; |
964 | 964 | ||
965 | this_cfs_rq = cpu_cfs_rq(busy_cfs_rq, this_cpu); | 965 | this_cfs_rq = cpu_cfs_rq(busy_cfs_rq, this_cpu); |
966 | 966 | ||
967 | imbalance = busy_cfs_rq->load.weight - | 967 | imbalance = busy_cfs_rq->load.weight - this_cfs_rq->load.weight; |
968 | this_cfs_rq->load.weight; | ||
969 | /* Don't pull if this_cfs_rq has more load than busy_cfs_rq */ | 968 | /* Don't pull if this_cfs_rq has more load than busy_cfs_rq */ |
970 | if (imbalance <= 0) | 969 | if (imbalance <= 0) |
971 | continue; | 970 | continue; |
@@ -976,7 +975,7 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest, | |||
976 | 975 | ||
977 | *this_best_prio = cfs_rq_best_prio(this_cfs_rq); | 976 | *this_best_prio = cfs_rq_best_prio(this_cfs_rq); |
978 | #else | 977 | #else |
979 | #define maxload rem_load_move | 978 | # define maxload rem_load_move |
980 | #endif | 979 | #endif |
981 | /* pass busy_cfs_rq argument into | 980 | /* pass busy_cfs_rq argument into |
982 | * load_balance_[start|next]_fair iterators | 981 | * load_balance_[start|next]_fair iterators |