linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Jonathan Lim <jlim@sgi.com>
Cc: Guillaume Chazarain <guichaz@yahoo.fr>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jay Lan <jlan@cthulhu.engr.sgi.com>
Subject: Re: [PATCH] Add all thread stats for TASKSTATS_CMD_ATTR_TGID
Date: Fri, 31 Aug 2007 12:54:47 +0530	[thread overview]
Message-ID: <46D7C23F.7020509@linux.vnet.ibm.com> (raw)
In-Reply-To: <200708310302.l7V32ZpV410222@sabah.engr.sgi.com>

Jonathan Lim wrote:
> On Sat Aug 25 21:58:44 2007, balbir@linux.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

  reply	other threads:[~2007-08-31  7:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-02 13:53 [PATCH] Add all thread stats for TASKSTATS_CMD_ATTR_TGID Guillaume Chazarain
2007-08-02 19:04 ` Andrew Morton
2007-08-19 19:34   ` Guillaume Chazarain
2007-08-20 17:01     ` Balbir Singh
2007-08-25 15:10       ` Guillaume Chazarain
2007-08-26  4:58         ` Balbir Singh
2007-08-26  9:44           ` Guillaume Chazarain
2007-08-31  3:02           ` Jonathan Lim
2007-08-31  7:24             ` Balbir Singh [this message]
2007-08-31 12:35               ` Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v3) Guillaume Chazarain
2007-09-13  0:18                 ` Andrew Morton
2007-09-15 18:42                   ` Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v4) Guillaume Chazarain
2007-09-17 22:23                     ` Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v5) Guillaume Chazarain
2007-09-18 15:29                       ` Oleg Nesterov
2007-09-20  6:20                       ` Andrew Morton
2007-09-20  8:54                         ` Balbir Singh
2007-09-20 12:16                           ` Oleg Nesterov
2007-09-20 12:17                             ` Balbir Singh
2007-09-07 23:37               ` [PATCH] Add all thread stats for TASKSTATS_CMD_ATTR_TGID Jonathan Lim
2007-09-10 13:03                 ` Guillaume Chazarain
2007-08-15  7:15 ` Balbir Singh
  -- strict thread matches above, loose matches on Subject: below --
2007-08-02 13:34 Guillaume Chazarain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46D7C23F.7020509@linux.vnet.ibm.com \
    --to=balbir@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=guichaz@yahoo.fr \
    --cc=jlan@cthulhu.engr.sgi.com \
    --cc=jlim@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).