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] [day] [month] [year] [list]
Message-ID: <20070511233701.GA13437@redhat.com>
Date:	Sat, 12 May 2007 01:37:01 +0200
From:	Tomas Janousek <tjanouse@...hat.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	john stultz <johnstul@...ibm.com>, linux-kernel@...r.kernel.org,
	tsmetana@...hat.com, riel@...hat.com
Subject: Re: [PATCH] Use boot based time for process start time and boot
	time in /proc

Hi,

On Fri, May 11, 2007 at 12:51:32PM -0700, Andrew Morton wrote:
> On Fri, 11 May 2007 10:45:31 +0200
> Tomas Janousek <tjanouse@...hat.com> wrote:
> 
> > Hello,
> > 
> > On Thu, May 10, 2007 at 04:40:47PM -0700, Andrew Morton wrote:
> > > Tomas Janousek <tjanouse@...hat.com> wrote:
> > > > @@ -445,12 +445,14 @@ static int show_stat(struct seq_file *p, void *v)
> > > >  	unsigned long jif;
> > > >  	cputime64_t user, nice, system, idle, iowait, irq, softirq, steal;
> > > >  	u64 sum = 0;
> > > > +	struct timespec boottime;
> > > >  
> > > >  	user = nice = system = idle = iowait =
> > > >  		irq = softirq = steal = cputime64_zero;
> > > > -	jif = - wall_to_monotonic.tv_sec;
> > > > -	if (wall_to_monotonic.tv_nsec)
> > > > -		--jif;
> > > > +	getboottime(&boottime);
> > > > +	jif = boottime.tv_sec;
> > > > +	if (boottime.tv_nsec)
> > > > +		++jif;
> > > >
> > > 

> >  	getboottime(&boottime);
> >  	jif = boottime.tv_sec;
> > -	if (boottime.tv_nsec)
> > -		++jif;
> >  

> So we've gone from --jif to ++jif to no change at all.
> 
> Are you sure that this net removal of --jif is correct?

Yes.

Let's say wall_to_monotonic = { -10, 500000 }  (which is { -9, -500000 }, and
the original code would result in - (- 10) - 1 == 9).

The getboottime calls set_normalized_timespec on { - (-10), - (500000) } which
results to { 10 - 1, - 500000 + 1000000 } = { 9, 500000 }.
tv_sec == 9  =>  correct.

-- 
TJ. (Brno, CZ), BaseOS, Red Hat
-
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