On Mon 23 Jul 2007 18:34, Andrew Morton pondered: > On Mon, 23 Jul 2007 18:15:37 -0400 > Robin Getz <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/