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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1102211610300.23557@chino.kir.corp.google.com>
Date:	Mon, 21 Feb 2011 16:13:14 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	Mike Travis <travis@....com>
cc:	Ingo Molnar <mingo@...e.hu>, Jack Steiner <steiner@....com>,
	Robin Holt <holt@....com>, Len Brown <len.brown@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Yinghai Lu <yhlu.kernel@...il.com>, linux-acpi@...r.kernel.org,
	x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/6] printk: Minimize time zero output

On Mon, 21 Feb 2011, Mike Travis wrote:

> > > Reduce the length for time zero messages by only printing "[0] ".
> > > 
> > > v2: updated to apply to x86-tip
> > > 
> > > Signed-off-by: Mike Travis <travis@....com>
> > > Reviewed-by: Jack Steiner <steiner@....com>
> > > Reviewed-by: Robin Holt <holt@....com>
> > > ---
> > >  kernel/printk.c |   11 ++++++++---
> > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > 
> > > --- linux.orig/kernel/printk.c
> > > +++ linux/kernel/printk.c
> > > @@ -735,9 +735,14 @@ static inline int printk_emit_time(void)
> > >  	unsigned long microsec_rem;
> > >   	t = cpu_clock(printk_cpu);
> > > -	microsec_rem = do_div(t, 1000000000) / 1000;
> > > -	tlen = sprintf(tbuf, "[%5lu.%06lu] ", (unsigned long)t, microsec_rem);
> > > -
> > > +	if (likely(t)) {
> > > +		microsec_rem = do_div(t, 1000000000) / 1000;
> > > +		tlen = sprintf(tbuf, "[%5lu.%06lu] ",
> > > +					(unsigned long)t, microsec_rem);
> > 
> > The definition of microsec_rem can become local to this clause.
> 
> Ok.
> > 
> > > +	} else {
> > > +		/* reduce byte count in log when time is zero */
> > > +		tlen = sprintf(tbuf, "[0] ");
> > 
> > If we know the padding when cpu_clock() is non-zero, then why not make sure
> > the kernel log is aligned properly by using the same padding here?
> 
> I'm not sure I understand what you are asking.  The whole point of this
> exercise is to remove bytes from the early log buffer so it does not
> overflow.  What would you like me to change?
> 

Based on your changelog, it looks like you're trying to avoid the time 
spent calculating the time (the divides), not trying to optimize for 
space, so I recommended "[    0.000000]" so the log is aligned.  If the 
patchset is reducing the number of lines emitted to the log, then this 
shouldn't be as significant of an issue?
--
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