Merge branch 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: [PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID [PATCH] improve idle cputime accounting [PATCH] improve precision of idle time detection. [PATCH] improve precision of process accounting. [PATCH] idle cputime accounting [PATCH] fix scaled & unscaled cputime accounting
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user