From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01FEAEB64D7 for ; Fri, 16 Jun 2023 13:50:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9487986213; Fri, 16 Jun 2023 15:50:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20221208.gappssmtp.com header.i=@baylibre-com.20221208.gappssmtp.com header.b="xWO+WOmV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5C1268622C; Fri, 16 Jun 2023 15:50:12 +0200 (CEST) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 720E286149 for ; Fri, 16 Jun 2023 15:50:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mkorpershoek@baylibre.com Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f8c65020dfso6439775e9.2 for ; Fri, 16 Jun 2023 06:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1686923409; x=1689515409; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=A3p29KUaKRJsJtIY4TuWXUN58gWNCWINHpWqHGj3Gj0=; b=xWO+WOmV2bD4eceui9MtUBgZWfhR6mfnZcd2HHsMAGrHznD529mdhUZJOCG5ZujHlF 0YIeHTzrTcfbZCeoYvumeAnhLqgjHmzqmnACxC2rm1fpfAvpAhvqjnl2ZH4bGELHiBEK sNRU/2aJ9gsTM0QHFNKTXL3Jcf+GFrtJ0w6I6U3UMO0We8rBgvH30wY810+ZGc+grDKW QW4vg91jmGwwG2RGHuRe/5agnT3lJvA+Fs7YAn1IjQmAEj/VAmxv43WYsGuHBtLVR5nN Kwxkao7GNepmJx1rhej6hp1hMY3KiMsqI2FS6XgKBEC1q0xmG9dYTzievzyHK1pex836 pCAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686923409; x=1689515409; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=A3p29KUaKRJsJtIY4TuWXUN58gWNCWINHpWqHGj3Gj0=; b=VtGSTat9Yx5zPq2yIQPLQJBCreW2u6lcHo1fwU+nVaxDajm7khustEh1reo6m7lw9U HPx/PhMgV9A8zR/BLtESb2cjitXGrvIEpyQHl5qfvnVfqLWo8teIi7wOOPF7YF2C5+CJ KlTyPqDi+8Heia+kq+A0qLv0GPltzgrkR8lvnL7LHWBT4r2g/UBNrGpLNrk6RM2ElAJS XN2fpI+p42onEkOXYDLehvx6nKU3oRoH822e+Ze9czansQMtMuzziyTy6pA2TDyTGG6+ iUhjhWK7XmnG0gJwJJ7YV7z+feHKOYiyDRLnhXXtRAdM9zTNpzDGx7f75RWcI01z7vQI pa0Q== X-Gm-Message-State: AC+VfDxjffr5I7bN4vw6IDI+reNWUJv+RqPVQccdgSr8oCStz9szoV9O skSKI9SzaJMJlUHHv0Iv/sFAxA== X-Google-Smtp-Source: ACHHUZ7biGHJz5Q2BimwSWZuOmdODGM4X8/RboQbktQeB1jIpbFD0Zu1dVj5qyMvWs466wUZckQjag== X-Received: by 2002:a5d:595a:0:b0:311:1a91:cdac with SMTP id e26-20020a5d595a000000b003111a91cdacmr1413956wri.57.1686923408883; Fri, 16 Jun 2023 06:50:08 -0700 (PDT) Received: from localhost ([2a01:cb19:85e6:1900:2bf7:7388:731d:c4e1]) by smtp.gmail.com with ESMTPSA id n6-20020a5d6b86000000b003111cbd8009sm2403474wrx.97.2023.06.16.06.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jun 2023 06:50:07 -0700 (PDT) From: Mattijs Korpershoek To: Sean Anderson , Gary Bisson Cc: u-boot@lists.denx.de, qianfanguijin@163.com, Troy Kisky , Peng Fan , sjg@chromium.org Subject: Re: [PATCH] Revert "lib: sparse: Make CHUNK_TYPE_RAW buffer aligned" In-Reply-To: <87ilbn8vsr.fsf@baylibre.com> References: <20221118121323.4009193-1-gary.bisson@boundarydevices.com> <79465afa-3528-7e1b-9d15-1258ef327f74@seco.com> <87ilbn8vsr.fsf@baylibre.com> Date: Fri, 16 Jun 2023 15:50:06 +0200 Message-ID: <87cz1v8qk1.fsf@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On ven., juin 16, 2023 at 13:56, Mattijs Korpershoek wrote: > Hi Gary, Sean, > > On lun., nov. 21, 2022 at 10:09, Sean Anderson 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