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]
Message-Id: <200707241350.45086.rgetz@blackfin.uclinux.org>
Date:	Tue, 24 Jul 2007 13:50:44 -0400
From:	Robin Getz <rgetz@...ckfin.uclinux.org>
To:	"Andrew Morton" <akpm@...ux-foundation.org>
Cc:	"Mike Frysinger" <vapier.adi@...il.com>,
	linux-kernel@...r.kernel.org, "Greg Ungerer" <gerg@...pgear.com>,
	"Russell King" <rmk@....linux.org.uk>,
	"Paul Mundt" <lethal@...ux-sh.org>,
	"Tim Bird" <tim.bird@...sony.com>, bryan.wu@...log.com
Subject: Re: early_printk accessing __log_buf

On Mon 23 Jul 2007 18:34, Andrew Morton pondered:
> On Mon, 23 Jul 2007 18:15:37 -0400
> Robin Getz <rgetz@...ckfin.uclinux.org> wrote:
> > 
> > A single function which does the copy as a loop (existing) is going to
> > be much faster than the overhead of 1024 function calls to copy the 
> > last k. 
> 
> I'd expect the overhead of the (fully-cached) instructions to be
> insignificant compared to the time to write to flash?

Maybe - the time to write a single page on NAND is pretty cheap.

SLC is 200us to program a page.
http://www.st.com/stonline/products/families/memories/fl_nand/nand_large.htm
http://www.st.com/stonline/products/families/memories/fl_nand/nand_small.htm

While you are correct - the majority of the time will be spent in the write to 
flash - the overhead of the loop 
 - call (3 cycles)
 - push a few registers on the stack (a cycle for each push),
 - pop same registers off the stack (a cycle for each pop).
 - return (5 cycles)

(Numbers go up and down depending on your arch - this was for 486)

If you assume three registers need to be pushed/popped - for a 1k buffer that 
is 14336 cycles of pure overhead - assuming 500MHz processor (and a perfect 
cache), that is 28us - about 14% of the time in overhead that doesn't need to 
be there.

Can someone increase the size of the capacitors in their power supply to make 
up for this - yes. But larger caps are more money.

> Lots of the kernel is pretty crappy.  One of our main tools for fixing
> that is to ensure that new stuff is non-crappy.

No problem - I wasn't advocating putting something that you thought was crappy 
into your tree (afterall that would be futile). Other than making the 
overhead high - is there a way to make it less crappy?

If the answer is no, and Mike's latest suggestion/patch is OK - that is what I 
will live with - and tell people to spend more on their power supply.

-robin
-
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