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:	Tue, 08 Aug 2006 10:52:17 +0530
From:	Balbir Singh <balbir@...ibm.com>
To:	Jay Lan <jlan@....com>
Cc:	Andrew Morton <akpm@...l.org>, lkml <linux-kernel@...r.kernel.org>,
	Shailabh Nagar <nagar@...son.ibm.com>,
	Jes Sorensen <jes@....com>,
	Chris Sturtivant <csturtiv@....com>, Tony Ernst <tee@....com>
Subject: Re: [patch 1/3] add basic accounting fields to taskstats

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.


> Regards,
>  - jay
> 
> 
> [snip]


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