[PATCH] powerpc: reduce number of WATCHDOG_RESET calls from flush_cache
Tom Rini
trini at konsulko.com
Fri Sep 18 16:50:58 CEST 2020
On Fri, Sep 18, 2020 at 10:20:46AM +0200, Rasmus Villemoes wrote:
> On 04/06/2020 12.31, Stefan Roese wrote:
> > On 04.06.20 11:30, Rasmus Villemoes wrote:
> >> Calling WATCHDOG_RESET for each and every cache line is overkill.
> >>
> >> In our case, the kernel image is a little over 7MB, and the almost
> >> 500000 calls of WATCHDOG_RESET() adds about one second to the
> >> boottime.
> >>
> >> I very highly doubt there's any real hardware where flushing 64K
> >> from cache to memory takes more than a few milliseconds, so this
> >> should be completely safe. Since it reduces the number of
> >> WATCHDOG_RESET() calls by roughly a factor of 1000, the overhead from
> >> those is practically eliminated. (Just in case the range flushed is so
> >> small that it doesn't cross a 64K boundary, add a single
> >> WATCHDOG_RESET() between the loops).
> >>
> >> 64K is chosen because that's also the default chunk size used by the
> >> hashing algorithms, and when, say, a sha256 digest of a kernel image of
> >> a few MB is being verified, that's almost guaranteed to be cache-cold,
> >> so apart from the computations being done, the hashing is also bounded
> >> by memory speed - so if 64K works for those cases, it should certainly
> >> also work when memory access is the only thing being done.
> >>
> >> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> >
> > Reviewed-by: Stefan Roese <sr at denx.de>
>
> Ping.
This too should end up in -next "soon". Thanks.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200918/b78f4180/attachment.sig>
More information about the U-Boot
mailing list