From 2ba13b79e734df0315ec0d12740406535a79385c Mon Sep 17 00:00:00 2001 From: Suresh Siddha Date: Wed, 4 Feb 2009 11:59:44 -0800 Subject: [PATCH] --- yaml --- r: 131263 b: refs/heads/master c: 483b4ee60edbefdfbff0dd538fb81f368d9e7c0d h: refs/heads/master i: 131261: ca39296824200e3e96c19abb831948504535301c 131259: 2e347baac3663ba5255211b0aad17a43cb3a9fd4 131255: 8ed5181d77a96e9cac0ac0b187f88e6169625761 131247: 8e4e67d5e8c8c1286fae588700d7c588eec7c878 131231: 58abfd5045a036b0168c6851d3e90ee0a3447c63 131199: 1ad79ab3d4cf8141c3be5e439ba7e533734a0949 v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/hpet.c | 2 +- trunk/include/linux/sched.h | 1 + trunk/kernel/sched.c | 17 +++++++++++------ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 67ce4c4e5d2a..26a69038c56c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a6a95406c676ffe4f9dee708eb404a17c69f7fdd +refs/heads/master: 483b4ee60edbefdfbff0dd538fb81f368d9e7c0d diff --git a/trunk/arch/x86/kernel/hpet.c b/trunk/arch/x86/kernel/hpet.c index c761f914430a..64d5ad0b8add 100644 --- a/trunk/arch/x86/kernel/hpet.c +++ b/trunk/arch/x86/kernel/hpet.c @@ -1075,7 +1075,7 @@ static void hpet_rtc_timer_reinit(void) hpet_t1_cmp += delta; hpet_writel(hpet_t1_cmp, HPET_T1_CMP); lost_ints++; - } while ((s32)(hpet_readl(HPET_COUNTER) - hpet_t1_cmp) > 0); + } while ((long)(hpet_readl(HPET_COUNTER) - hpet_t1_cmp) > 0); if (lost_ints) { if (hpet_rtc_flags & RTC_PIE) diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 5a7c76388731..2127e959e0f4 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -443,6 +443,7 @@ struct pacct_struct { * @utime: time spent in user mode, in &cputime_t units * @stime: time spent in kernel mode, in &cputime_t units * @sum_exec_runtime: total time spent on the CPU, in nanoseconds + * @lock: lock for fields in this struct * * This structure groups together three kinds of CPU time that are * tracked for threads and thread groups. Most things considering diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 242d0d47a70d..e1fc67d0674c 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -3890,19 +3890,24 @@ int select_nohz_load_balancer(int stop_tick) int cpu = smp_processor_id(); if (stop_tick) { - cpumask_set_cpu(cpu, nohz.cpu_mask); cpu_rq(cpu)->in_nohz_recently = 1; - /* - * If we are going offline and still the leader, give up! - */ - if (!cpu_active(cpu) && - atomic_read(&nohz.load_balancer) == cpu) { + if (!cpu_active(cpu)) { + if (atomic_read(&nohz.load_balancer) != cpu) + return 0; + + /* + * If we are going offline and still the leader, + * give up! + */ if (atomic_cmpxchg(&nohz.load_balancer, cpu, -1) != cpu) BUG(); + return 0; } + cpumask_set_cpu(cpu, nohz.cpu_mask); + /* time for ilb owner also to sleep */ if (cpumask_weight(nohz.cpu_mask) == num_online_cpus()) { if (atomic_read(&nohz.load_balancer) == cpu)