From: Jay Lan <jlan@engr.sgi.com>
To: balbir@in.ibm.com
Cc: 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: Tue, 08 Aug 2006 09:40:17 -0700 [thread overview]
Message-ID: <44D8BE71.4010807@engr.sgi.com> (raw)
In-Reply-To: <44D81F89.3050009@in.ibm.com>
Balbir Singh wrote:
> Jay Lan wrote:
>> 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.
>>
>
> But the scheduling happens in the granularity of a tick, so the
> minimum each task gets is a tick.
>
>> 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.
>>
>
> Can't we leave these values as zero in case both stime and utime are
> zero.
Yes, i will leave them as zero in this case.
Regards,
- jay
>
>
>> Regards,
>> - jay
>>
>>
>> [snip]
>
>
next prev parent reply other threads:[~2006-08-08 16:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-31 19:20 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
2006-08-08 5:22 ` Balbir Singh
2006-08-08 16:40 ` Jay Lan [this message]
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=44D8BE71.4010807@engr.sgi.com \
--to=jlan@engr.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome