Merge branch 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
[linux-2.6.git] / arch / powerpc / kernel / time.c
index 99f1ddd68582e9628456f8d8e7f8fe3fb0c5b25f..c9564031a2a9c7878f9e9a694fe8e9ca3622a85e 100644 (file)
@@ -256,8 +256,10 @@ void account_system_vtime(struct task_struct *tsk)
                delta += sys_time;
                get_paca()->system_time = 0;
        }
-       account_system_time(tsk, 0, delta);
-       account_system_time_scaled(tsk, deltascaled);
+       if (in_irq() || idle_task(smp_processor_id()) != tsk)
+               account_system_time(tsk, 0, delta, deltascaled);
+       else
+               account_idle_time(delta);
        per_cpu(cputime_last_delta, smp_processor_id()) = delta;
        per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled;
        local_irq_restore(flags);
@@ -275,10 +277,8 @@ void account_process_tick(struct task_struct *tsk, int user_tick)
 
        utime = get_paca()->user_time;
        get_paca()->user_time = 0;
-       account_user_time(tsk, utime);
-
        utimescaled = cputime_to_scaled(utime);
-       account_user_time_scaled(tsk, utimescaled);
+       account_user_time(tsk, utime, utimescaled);
 }
 
 /*
@@ -338,8 +338,12 @@ void calculate_steal_time(void)
        tb = mftb();
        purr = mfspr(SPRN_PURR);
        stolen = (tb - pme->tb) - (purr - pme->purr);
-       if (stolen > 0)
-               account_steal_time(current, stolen);
+       if (stolen > 0) {
+               if (idle_task(smp_processor_id()) != current)
+                       account_steal_time(stolen);
+               else
+                       account_idle_time(stolen);
+       }
        pme->tb = tb;
        pme->purr = purr;
 }