[U-Boot] [PATCH 0/5] New environment code
Wolfgang Denk
wd at denx.de
Sat Jul 17 23:31:43 CEST 2010
Dear Reinhard Meyer,
In message <4C42190B.8060102 at emk-elektronik.de> you wrote:
>
> how many users are out there that have such huge environments that speed
> is of any concern?
This is not so much a question of huge environments. Even with small
environments (say, 2 kb) speed may quickly become an issue - see for
example here:
http://www.denx.de/wiki/DULG/AN2004_11_BootTimeOptimization (Step 2)
Even worse is the fact that the old code recomputes the CRC over the
whole environment for each and every "setenv" - and for example a
network download will run 4 (or more) "setenv" commands internally...
Or remember the tricks that were necessary to get netconsole and
serial console work in parallel...
And so on... the deeper you look, the more issues you will find with
the old code. It has been designed to be simple to implement, but we
added a lot of usage modes since, and while I still think it's a
pretty efficient format for external storage, we need more efficient
ways when internally accessing the environment files.
> The "grepenv" idea however seems to indicate some might have huge
> environments...
>
> I see the advantages offered, but
>
> > Disadvantages:
> >
> > - Image size grows by typically 5...7 KiB (might shrink a bit again on
> > systems with redundant environment with a following patch series)
Yes, it's some 2...3% on many systems...
> Looking at the patches I can't really see where that large increase in
> image size comes from;
Well, the hashtable code itself adds some 3 kB, a few hundret bytes
are needed for qsort, etc.
> but if its really true, it seems to be a very high price to pay for
> those who get along with the
> environment as it is.
I hear you.
> I would at least recommend that all new UI commands are optional; as basics
> "setenv", "printenv", "saveenv" should do as until now. "export" and
> "import" must be adding
> a lot to the code.
Actually it's not that much, and the code is needed anyway as it is
used to read (import) the environment as stored in flash / nand /
whatever into the hash table when booting, and to export it again
when running "saveenv". The remaining UI commands are tiny; they
don't consume any significant space.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A Freudian slip is when you say one thing but mean your mother.
More information about the U-Boot
mailing list