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]
Date:	Fri, 31 Aug 2007 12:54:47 +0530
From:	Balbir Singh <balbir@...ux.vnet.ibm.com>
To:	Jonathan Lim <jlim@....com>
CC:	Guillaume Chazarain <guichaz@...oo.fr>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Jay Lan <jlan@...ulhu.engr.sgi.com>
Subject: Re: [PATCH] Add all thread stats for TASKSTATS_CMD_ATTR_TGID

Jonathan Lim wrote:
> On Sat Aug 25 21:58:44 2007, balbir@...ux.vnet.ibm.com wrote:
>>> Also, I don't understand why the code to update btime:
>>>
>>>         /* calculate task elapsed time in timespec */
>>>         do_posix_clock_monotonic_gettime(&uptime);
>>>         ts = timespec_sub(uptime, tsk->start_time);
>>> 	...
>>>         stats->ac_btime = get_seconds() - ts.tv_sec;
>>>
>>> does not simply use tsk->start_time or tsk->real_start_time without
>>> comparing it to the current time.
>> From what I understand, task->start_time and task->real_start_time
>> are taken from the realtime clock. The accounting in CSA seems
>> to be very similar to the accounting done in do_acct_process()
>> (kernel/acct.c).
> 
> In CSA 3.0 ...
> 
> csa_acct_eop(int exitcode, struct task_struct *p)
> 
>         csa->ac_btime = boottime +
>                         ((p->start_time.tv_nsec < NSEC_PER_SEC/2) ?
>                          p->start_time.tv_sec :
>                          p->start_time.tv_sec +1);
> 
> where 
> 
>         do_posix_clock_monotonic_gettime(&uptime);
>         boottime = xtime.tv_sec - uptime.tv_sec;
> 
> In an upcoming version of CSA ...
> 
> csa_acct_eop(struct taskstats *p)
> 
>         csa->ac_btime = p->ac_btime;
> 
> where
> 
>         do_posix_clock_monotonic_gettime(&uptime);
>         ts = uptime - tsk->start_time;
>         p->ac_btime = get_seconds() - ts.tv_sec;
>                     = xtime.tv_sec - (uptime - tsk->start_time);
>                     = (xtime.tv_sec - uptime) + tsk->start_time;
> 
> So they're basically equivalent.

Excellent, so can Guillaume change ac_btime to be just tsk->start_time?

-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
-
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