OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 0/9] Containers (V9): Generic Process Containers
Re: [PATCH 2/9] Containers (V9): Example CPU accounting subsystem [message #12492 is a reply to message #12416] Tue, 01 May 2007 17:52 Go to previous messageGo to previous message
Balbir Singh is currently offline  Balbir Singh
Messages: 491
Registered: August 2006
Senior Member
menage@google.com wrote:
> +
> +/* Lazily update the load calculation if necessary. Called with ca locked */
> +static void cpuusage_update(struct cpuacct *ca)
> +{
> + u64 now = get_jiffies_64();
> + /* If we're not due for an update, return */
> + if (ca->next_interval_check > now)
> + return;
> +
> + if (ca->next_interval_check <= (now - INTERVAL)) {

These two conditions seem a little confusing.

If ca->next_interval_check > (now - INTERVAL), the else part
is executed, but if ca->next_interval_check > (now - INTERVAL)
then ca->next_interval_check > now, which implies we return
and never enter the else part. It's been quite sometime since
I looked at this code, so I might have gotten it wrong.
I see a load of 0% on my powerpc box. I think it is because
last_interval_time is always 0, I'll debug further


--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH -utrace] Move utrace into task_struct
Next Topic: [patch 39/68] attach_pid() with struct pid parameter
Goto Forum:
  


Current Time: Fri Aug 01 05:40:53 GMT 2025

Total time taken to generate the page: 0.79157 seconds