public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Sean Anderson <sean.anderson@seco.com>,
	Gary Bisson <gary.bisson@boundarydevices.com>
Cc: u-boot@lists.denx.de, qianfanguijin@163.com,
	Troy Kisky <troy.kisky@boundarydevices.com>,
	Peng Fan <peng.fan@nxp.com>,
	sjg@chromium.org
Subject: Re: [PATCH] Revert "lib: sparse: Make CHUNK_TYPE_RAW buffer aligned"
Date: Fri, 16 Jun 2023 15:50:06 +0200	[thread overview]
Message-ID: <87cz1v8qk1.fsf@baylibre.com> (raw)
In-Reply-To: <87ilbn8vsr.fsf@baylibre.com>

On ven., juin 16, 2023 at 13:56, Mattijs Korpershoek <mkorpershoek@baylibre.com> wrote:

> Hi Gary, Sean,
>
> On lun., nov. 21, 2022 at 10:09, Sean Anderson <sean.anderson@seco.com> wrote:
>
>> On 11/21/22 09:50, Gary Bisson wrote:
>>> Hi,
>>> 
>>> On Fri, Nov 18, 2022 at 10:36:58AM -0500, Sean Anderson wrote:
>>>> On 11/18/22 07:13, Gary Bisson wrote:
>>>> > This reverts commit 62649165cb02ab95b57360bb362886935f524f26.
>>>> > 
>>>> > The patch decreased the write performance quite a bit.
>>>> > Here is an example on an i.MX 8M Quad platform.
>>>> > - Before the revert:
>>>> > Sending sparse 'vendor' 1/2 (516436 KB)            OKAY [  5.113s]
>>>> > Writing 'vendor'                                   OKAY [128.335s]
>>>> > Sending sparse 'vendor' 2/2 (76100 KB)             OKAY [  0.802s]
>>>> > Writing 'vendor'                                   OKAY [ 27.902s]
>>>> > - After the revert:
>>>> > Sending sparse 'vendor' 1/2 (516436 KB)            OKAY [  5.310s]
>>>> > Writing 'vendor'                                   OKAY [ 18.041s]
>>>> > Sending sparse 'vendor' 2/2 (76100 KB)             OKAY [  1.244s]
>>>> > Writing 'vendor'                                   OKAY [  2.663s]
>>>> > 
>>>> > Considering that the patch only moves buffer around to avoid a warning
>>>> > message about misaligned buffers, let's keep the best performances.
>>>> 
>>>> So what is the point of this warning?
>>> 
>>> Well the warning does say something true that the cache operation is not
>>> aligned. Better ask Simon as he's the one who changed the print from a
>>> debug to warn_non_spl one:
>>> bcc53bf0958 arm: Show cache warnings in U-Boot proper only
>>> 
>>> BTW, in my case I couldn't see the misaligned messages, yet I saw the
>>> performance hit described above.
>
> I also reproduce this problem on AM62x SK EVM.
>
> Before the revert:
> Sending sparse 'super' 1/2 (768793 KB)             OKAY [ 23.954s]
> Writing 'super'                                    OKAY [ 75.926s]
> Sending sparse 'super' 2/2 (629819 KB)             OKAY [ 19.641s]
> Writing 'super'                                    OKAY [ 62.849s]
> Finished. Total time: 182.474s
>
> After the revert:
> Sending sparse 'super' 1/2 (768793 KB)             OKAY [ 23.895s]
> Writing 'super'                                    OKAY [ 12.961s]
> Sending sparse 'super' 2/2 (629819 KB)             OKAY [ 19.562s]
> Writing 'super'                                    OKAY [ 12.805s]
> Finished. Total time: 69.327s
>
> And like Gary, I did not observe the misaligned messages.
>
> Did we come up with a solution for this performance regression?
>
> I will continue looking on my end but please let me know if you already
> solved this.

Answering to myself here. My attempt of solving this problem has been
submitted here:

https://lore.kernel.org/r/20230616-sparse-flash-fix-v1-1-6bafeacc567b@baylibre.com


>
> Thanks,
>
> Matijs
>
>>
>> Maybe it is better to keep this as a Kconfig? Some arches may support
>> unaligned access but others may not. I wonder if we have something like
>> this already.
>>
>> --Seam

  reply	other threads:[~2023-06-16 13:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 12:13 [PATCH] Revert "lib: sparse: Make CHUNK_TYPE_RAW buffer aligned" Gary Bisson
2022-11-18 15:36 ` Sean Anderson
2022-11-21 14:50   ` Gary Bisson
2022-11-21 15:09     ` Sean Anderson
2023-06-16 11:56       ` Mattijs Korpershoek
2023-06-16 13:50         ` Mattijs Korpershoek [this message]
2023-06-17 14:55           ` Tom Rini

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=87cz1v8qk1.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=gary.bisson@boundarydevices.com \
    --cc=peng.fan@nxp.com \
    --cc=qianfanguijin@163.com \
    --cc=sean.anderson@seco.com \
    --cc=sjg@chromium.org \
    --cc=troy.kisky@boundarydevices.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