From: Jay Lan <jlan@sgi.com>
To: Jay Lan <jlan@sgi.com>
Cc: balbir@in.ibm.com, Andrew Morton <akpm@osdl.org>,
lkml <linux-kernel@vger.kernel.org>,
Shailabh Nagar <nagar@watson.ibm.com>, Jes Sorensen <jes@sgi.com>,
Chris Sturtivant <csturtiv@sgi.com>, Tony Ernst <tee@sgi.com>
Subject: Re: [patch 1/3] add basic accounting fields to taskstats
Date: Mon, 07 Aug 2006 14:23:00 -0700 [thread overview]
Message-ID: <44D7AF34.10301@sgi.com> (raw)
In-Reply-To: <44CFCCE4.7060702@sgi.com>
Jay Lan wrote:
[snip]
>>
>>
>>> + /* Each process gets a minimum of a half tick cpu time */
>>> + if ((stats->ac_utime == 0) && (stats->ac_stime == 0)) {
>>> + stats->ac_stime = USEC_PER_TICK/2;
>>> + }
>>> +
>>
>>
>>
>> This is confusing. Half tick does not make any sense from the
>> scheduler view point (or am I missing something?), so why
>> return half a tick to the user.
>
>
> It must be inherited from old code dated back to Cray UNICOS.
> I do not know if bad thing can happen if both utime and stime
> are less than 1 usec... I guess not. But i agree that
> half a tick does not make sense. To play safe, we can change
> it to 1 usec if both utime and stime are sub microsecond.
> What do you think?
Hi Balbir,
I figured this out. The tsk->stime (and utime as well) are
charged by 1 tick (or cputime) from the timer interrupt handler
through update_process_times->account_{user,system}_time.
The clock resolution is a tick. Any short process less than
1 tick will the counter being 0. It can be from 0 to 0.99999...
tick. A half tick is the average value.
I think it makes more sense to assign a half tick than assign
1 usec to the stime. What do you think? Certainly the code need
better explanation.
Regards,
- jay
[snip]
next prev parent reply other threads:[~2006-08-07 21:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-31 19:20 [patch 1/3] add basic accounting fields to taskstats Jay Lan
2006-07-31 20:23 ` Shailabh Nagar
2006-07-31 21:50 ` Jay Lan
2006-08-01 14:24 ` Balbir Singh
2006-08-01 21:51 ` Jay Lan
2006-08-02 15:31 ` Shailabh Nagar
2006-08-02 17:17 ` Balbir Singh
2006-08-02 17:37 ` Shailabh Nagar
2006-08-02 21:09 ` Andrew Morton
2006-08-02 23:47 ` Jay Lan
2006-08-03 3:02 ` Balbir Singh
2006-08-07 21:23 ` Jay Lan [this message]
2006-08-08 5:22 ` Balbir Singh
2006-08-08 16:40 ` Jay Lan
-- strict thread matches above, loose matches on Subject: below --
2006-08-08 14:57 Al Boldi
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=44D7AF34.10301@sgi.com \
--to=jlan@sgi.com \
--cc=akpm@osdl.org \
--cc=balbir@in.ibm.com \
--cc=csturtiv@sgi.com \
--cc=jes@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nagar@watson.ibm.com \
--cc=tee@sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.