public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Aneesh V <aneesh@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Skipping relocation RAM to RAM, esp. on i.MX6?
Date: Thu, 09 Feb 2012 19:13:31 +0530	[thread overview]
Message-ID: <4F33CD83.6080302@ti.com> (raw)
In-Reply-To: <20120209114417.2CEC0193BB47@gemini.denx.de>

On Thursday 09 February 2012 05:14 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4F33614D.8020904@ti.com>  you wrote:
>>
>>> What exactly are you talking about here that "was adding a
>>> considerable delay" - the memory copy ?  Are you really sure about
>>> that?
>>
>> I didn't measure it part by part, but removing relocation gave a
>> noticeable speed-up, this platform is several orders of magnitude
>> slower than the real silicon. So, that should not be surprising.
>
> Could you please start using exact terminology, so we understand what
> you actually refer to?  Did you really remove the _relocation_, i. e.
> link for a static address, or did you just skip the memory copy?  Note
> that the latter should be a no-op anyway if you just load the image to
> the resulting target address.

I defeated relocation by passing to the relocate_code() function the
same address as it is linked to. I patched up arch/arm/lib/board.c for
this and fixed up the relocate_code() to correctly handle this special
case. So, relocate_code() does only .bss init now.

>
>> Maybe, I should stop the arguments now and wait till that framework is
>> a reality.
>
> I am very much convinced that you are tracking down a red herring.  It
> does not really matter if you run the code on real silicon or in an
> emulation - the relative times will always be the same.  Without any
> detailed timing analysis I simply do not believe you that you really
> have found a hot spot.  You focus on it because you found out that it
> exists and you think it was "not needed" in your configuration -
> without spending time on real optimization.

Please note that our bootloaders and kernel are customized and scaled
down for this environment. For instance, u-boot doesn't load the kernel
from network or a memory device. The kernel is preloaded in the modeled
memory for it. So, u-boot was just used to jump to the kernel. As such,
the u-boot run-time is now more dominated by pure software stuff such
as relocation. The relative timing doesn't quite apply.

>
> This is a fundamentally broken approach, and it will remain to be
> broken even if new concepts get implemented that may make it easier to
> skip certain steps of the initialization.
>
> If you are concerned about boot time optimization, you _must_ start
> with timing measurements.  You know where premature optimization leads
> to, don't you?

As I mentioned earlier boot-time is not my key care-about. Even on an
emulation platform I will probably try SPL Linux boot next time. My key
concerns are about the other aspects I mentioned, namely avoidable
complexity and problems with debugger.

br,
Aneesh

  reply	other threads:[~2012-02-09 13:43 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03  7:25 [U-Boot] Skipping relocation RAM to RAM, esp. on i.MX6? Dirk Behme
2012-02-03  8:51 ` Stefano Babic
2012-02-03 10:18   ` Dirk Behme
2012-02-03 11:00     ` Stefano Babic
2012-02-03 11:19       ` Mike Frysinger
2012-02-04  8:38       ` [U-Boot] i.MX5/6 U-Boot: Cache enabling (was: Re: Skipping relocation RAM to RAM, esp. on i.MX6?) Dirk Behme
2012-02-04  9:18         ` [U-Boot] i.MX5/6 U-Boot: Cache enabling Aneesh V
2012-02-04 10:18         ` [U-Boot] i.MX5/6 U-Boot: Cache enabling (was: Re: Skipping relocation RAM to RAM, esp. on i.MX6?) Marek Vasut
2012-02-08 13:37           ` [U-Boot] i.MX5/6 U-Boot: Cache enabling Dirk Behme
2012-02-09  7:06             ` Marek Vasut
2012-02-04  9:15 ` [U-Boot] Skipping relocation RAM to RAM, esp. on i.MX6? Aneesh V
2012-02-04 11:00   ` Albert ARIBAUD
2012-02-04 11:14     ` Aneesh V
2012-02-04 11:37       ` Albert ARIBAUD
2012-02-06 14:34     ` Tom Rini
2012-02-06 21:21       ` Albert ARIBAUD
2012-02-06 22:27         ` Wolfgang Denk
2012-02-06 22:41           ` Graeme Russ
2012-02-07  7:19             ` Aneesh V
2012-02-07 23:26               ` Wolfgang Denk
2012-02-08  6:43                 ` Aneesh V
2012-02-08 13:58                   ` Wolfgang Denk
2012-02-08 14:48                     ` Aneesh V
2012-02-08 16:23                       ` Wolfgang Denk
2012-02-09  6:01                         ` Aneesh V
2012-02-09 11:44                           ` Wolfgang Denk
2012-02-09 13:43                             ` Aneesh V [this message]
2012-02-05  6:19   ` Simon Glass
2012-02-06 14:19     ` Aneesh V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F33CD83.6080302@ti.com \
    --to=aneesh@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox