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 C2866EB64D7 for ; Fri, 16 Jun 2023 11:57:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7EB2F8611C; Fri, 16 Jun 2023 13:56:59 +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="j8KAVVOk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 577DE86103; Fri, 16 Jun 2023 13:56:57 +0200 (CEST) Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (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 CB7418622D for ; Fri, 16 Jun 2023 13:56:54 +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-x32f.google.com with SMTP id 5b1f17b1804b1-3f8d2bfed53so5194475e9.1 for ; Fri, 16 Jun 2023 04:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1686916614; x=1689508614; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Lp4/CMvt9O4M9QYQ1Ms7WMEg2blFayyglLU9En+fOLY=; b=j8KAVVOkkigHu2uTrVDuJ0dZj3joJHKbOhbIoD783MZRS4c5dNRlGkoV6QQOt/Z+qH hhJBQXyna92+Z3NZK1qfSd78v0zy8BptYMuWa7L4oaWp62M/5aL39xydqGwzf86NSEY8 pb/AGVfFH5vg9HLMtVZUpo1qw6I51x/8JdOo1gQZxrjTCbRlCK8qBmIKm3coxknHr1Bv yeFTeON0khIFfu/brY0rXDAin0OY1e5e7XI8cFdrzn6R/es72v6oulpmWOVLWaVnX/72 MW3kuaIjTEZ5rDzck/DalXaA/+djn82yfgcPJ+5v87jjyyPhgZerS+uxrCH1NIDN61av TjBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686916614; x=1689508614; 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=Lp4/CMvt9O4M9QYQ1Ms7WMEg2blFayyglLU9En+fOLY=; b=asjQVRCtwS3oE0CUioc+jigTG8mMbwdbz03inOan9zVOTdQJWWMfBxLDKIXsqTbcGM kLW1ZVIWM5uLqJe1KXVvNoQDLSOJYI145RyfmoSDO7RPdZPtSvPQt+ErtKcE89k/SPim WXf3KMMKUAI33Ab9r/UY4UnPq2Eck4y5gfd7OB3tVGTo2FEJUl83J6CyYzvJwogAQV5I 1o1rAtIecHlx7/WpFP+qcdarsJh1KPb4ouoc7jX12hPvet/1xaDu5Sn4Z40XQX2SBHuG d07W3Kq6eJndPBjwPcv/5ELOg6V/DaAHLltOrqQk3mS7Doobl0c+fJc82+kwiLynE7uJ RM3g== X-Gm-Message-State: AC+VfDwe2xoGVKHUA5ZORFpekLAgo1dJ+TF8hRysyosDXteilWToLo3J ASfP/M5oA/li94dEATdnxyjk6g== X-Google-Smtp-Source: ACHHUZ6p9/gxbKrUqQA+lyDzkaMoMxC2ocvjpd5L83Xgq7/uZwFAV4BgOH7WJmZelocZBO2FR0IZmg== X-Received: by 2002:a05:600c:5562:b0:3f7:ba55:d03e with SMTP id ja2-20020a05600c556200b003f7ba55d03emr6829762wmb.6.1686916614079; Fri, 16 Jun 2023 04:56:54 -0700 (PDT) Received: from localhost ([2a01:cb19:85e6:1900:2bf7:7388:731d:c4e1]) by smtp.gmail.com with ESMTPSA id t24-20020a7bc3d8000000b003f60a9ccd34sm1966633wmj.37.2023.06.16.04.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jun 2023 04:56:53 -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: References: <20221118121323.4009193-1-gary.bisson@boundarydevices.com> <79465afa-3528-7e1b-9d15-1258ef327f74@seco.com> Date: Fri, 16 Jun 2023 13:56:52 +0200 Message-ID: <87ilbn8vsr.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 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. 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