lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080624123951.GJ2896@zip.com.au>
Date:	Tue, 24 Jun 2008 22:39:52 +1000
From:	AP <ap@....com.au>
To:	Michael Kerrisk <mtk.manpages@...glemail.com>
Cc:	Laurent Vivier <Laurent.Vivier@...l.net>,
	Michael Kerrisk <mtk.manpages@...il.com>,
	Samuel Thibault <samuel.thibault@...-lyon.org>,
	lkml <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Christian Borntraeger <borntraeger@...ibm.com>
Subject: Re: /proc 2.6.24 changes for guest CPU accounting

On Mon, Jun 23, 2008 at 12:51:11PM +0200, Michael Kerrisk wrote:
> > You must also notes that "user time" includes "guest time", if you want
> > real "user time" you must subtract "guest time".
> > The "guest time" is included in "user time" to not loose it when the
> > "reader" is not aware of the "guest time".
> 
> Hi Laurent (and Christian)
> 
> So, I just want to confirm.  You are saying that guest_time and
> cguest_time are respectively also included in the following fields
> 
>               utime %lu
...
>               cutime %ld
...
> Right?

If this function in ./kernel/sched.c is anything to go by and I'm not
being a complete noob, yes:

/*
 * Account guest cpu time to a process.
 * @p: the process that the cpu time gets accounted to
 * @cputime: the cpu time spent in virtual machine since the last update
 */
static void account_guest_time(struct task_struct *p, cputime_t cputime)
{
        cputime64_t tmp;
        struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;

        tmp = cputime_to_cputime64(cputime);

        p->utime = cputime_add(p->utime, cputime);
        p->gtime = cputime_add(p->gtime, cputime);

        cpustat->user = cputime64_add(cpustat->user, tmp);
        cpustat->guest = cputime64_add(cpustat->guest, tmp);
}

As such, I'll follow up with a new version of my previous patch.

AP
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ