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 A871CEB64DD for ; Tue, 25 Jul 2023 21:13:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0AD7586785; Tue, 25 Jul 2023 23:13:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="EJHYBU7d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 29CF1867B3; Tue, 25 Jul 2023 23:13:00 +0200 (CEST) Received: from mail-vk1-xa2d.google.com (mail-vk1-xa2d.google.com [IPv6:2607:f8b0:4864:20::a2d]) (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 948AF8678C for ; Tue, 25 Jul 2023 23:12:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-vk1-xa2d.google.com with SMTP id 71dfb90a1353d-4813422f311so2235818e0c.2 for ; Tue, 25 Jul 2023 14:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1690319575; x=1690924375; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BSJNGQnEQMXNpXc/BBBFtzxeX1wHCfL+CA5++FA7t6c=; b=EJHYBU7dhpSnlBdv4yTVcjyRQAHBl3yEjIqoTa7ZPyBZ4lFBbHmRQpZbJU/qANfAn/ 2Nb2sclu+8OPazAv6oi++Dyof0p+26/aKrPt3lkOtKxO3CpYxEv6PiCMlfS4zxMK1khx XRPUjdV7SEncYtgAgjM2A9826MrJ+ZLth2/Uc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690319575; x=1690924375; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BSJNGQnEQMXNpXc/BBBFtzxeX1wHCfL+CA5++FA7t6c=; b=fgM+rmZr5kYcAj6BSifRBazEc9GAkz1BfcGImIEYY03LCT8Xm/if+PZCVpYLqexhDa hXuqGrzT20Jy6GTybUz+3/vk6nt2Q76tTjSR1ti8Sx3y3o93nHNHGOfG442RxnSihU/y sFRGFasNZhx+1njwoMeAHe2V9WhpJQG8ERrOhuN673cf54j1BqsxBcecGoE5189FVIQA aGTwRGuihCDp2e+AWRyVA3pOZyo/nx6jnPLzSmbDqDS2b3AlLMzBBFADHlP1rYn/lkNf pCQbv1idgXhnkCHHegAm153TsWxiLCS7qaKhU7Zp16EiCtOCLsOc7q0uGMRisX3GjTsS Wayg== X-Gm-Message-State: ABy/qLank343EcYaaIl+gwqU1eSv1fVdwe04bM632WIecC3weYTARFLT 1x7wwEU+BNUNJzZFk1CFp8Q0Kc6IqFEMY5jfoEPXeA== X-Google-Smtp-Source: APBJJlHc3qrAXyk+gqKMNtlgYKFAw8B2/7i3ITZeUyTcXfzLgVzOU0X70X1k/XwkAKAFdIutzjMtvw== X-Received: by 2002:a1f:3f02:0:b0:483:9adf:af19 with SMTP id m2-20020a1f3f02000000b004839adfaf19mr249623vka.2.1690319575263; Tue, 25 Jul 2023 14:12:55 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-b236-e3a5-57be-379d.res6.spectrum.com. [2603:6081:7b00:6400:b236:e3a5:57be:379d]) by smtp.gmail.com with ESMTPSA id h7-20020a0561220b6700b0047dbd48bc44sm1761557vkf.17.2023.07.25.14.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 14:12:54 -0700 (PDT) Date: Tue, 25 Jul 2023 17:12:52 -0400 From: Tom Rini To: Mattijs Korpershoek Cc: qianfan Zhao , Sean Anderson , Guillaume La Roque , Gary Bisson , Troy Kisky , u-boot@lists.denx.de Subject: Re: [PATCH v2] lib: sparse: allocate FASTBOOT_MAX_BLK_WRITE instead of small number Message-ID: <20230725211252.GI3630934@bill-the-cat> References: <20230616-sparse-flash-fix-v2-1-25717e6cbb27@baylibre.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="T0R1pqbk4pFMPeTD" Content-Disposition: inline In-Reply-To: <20230616-sparse-flash-fix-v2-1-25717e6cbb27@baylibre.com> X-Clacks-Overhead: GNU Terry Pratchett 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 --T0R1pqbk4pFMPeTD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 07, 2023 at 10:13:34AM +0200, Mattijs Korpershoek wrote: > Commit 62649165cb02 ("lib: sparse: Make CHUNK_TYPE_RAW buffer aligned") > fixed cache alignment for systems with a D-CACHE. >=20 > However it introduced some performance regressions [1] on system > flashing huge images, such as Android. >=20 > On AM62x SK EVM, we also observe such performance penalty: > 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 >=20 > The reason for this is that we use an arbitrary small buffer > (info->blksz * 100) for transferring. >=20 > Fix it by using a bigger buffer (info->blksz * FASTBOOT_MAX_BLK_WRITE) > as suggested in the original's patch review [2]. >=20 > With this patch, performance impact is mitigated: > Sending sparse 'super' 1/2 (768793 KB) OKAY [ 23.912s] > Writing 'super' OKAY [ 15.780s] > Sending sparse 'super' 2/2 (629819 KB) OKAY [ 19.581s] > Writing 'super' OKAY [ 17.192s] > Finished. Total time: 76.569s >=20 > [1] https://lore.kernel.org/r/20221118121323.4009193-1-gary.bisson@bounda= rydevices.com > [2] https://lore.kernel.org/r/all/43e4c17c-4483-ec8e-f843-9b4c5569bd18@se= co.com/ >=20 > Fixes: 62649165cb02 ("lib: sparse: Make CHUNK_TYPE_RAW buffer aligned") > Signed-off-by: Mattijs Korpershoek Applied to u-boot/master, thanks! --=20 Tom --T0R1pqbk4pFMPeTD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmTAOtQACgkQFHw5/5Y0 tywq6wv/Z6dlTLYIRaojrZBsgPKd3fUDj5k451Dw0sXjZzlSjjAlxuNK0FQdUZDk AZtrl0zKQ6nFWYIzFI6/ZOlmVk7bb3Jvh73bIAO/v8xACoCa1lR7cIY4KcmBPTPL LqGr1CdpnxLs3+B4vVg3PLe0GeGJ0j3ioSH4y8EVO63/X7e4HgJ/vhiUP2u3ijI9 gZNNINjk9j7jborLYoZekA22WygUtqP55767c/+SKM4x75y3LYCj94a2YR9jtxwt hP6pZ/GiN8HjOGeEJiudBViHZ3HeRKwoPlMHDPA3qHlressudG+KB9m2pFwNkkHi wTxKhvncFzOTISsIdaThfWpeRb/L9u7CgUqt5Qte7OK+FyvUaoVx8afFaIXsemYY 0IY3TVvWtGoLdBue8O0c6R0zJw2m4wLXthkXPqUnlRvx5fccUeSvKAYtJFHQxN96 Y17E9yZgGnPcsCMMdZtLnJ0NBFdqA/+EeyThBWQNO++nP/6b1R2//wmzdwfOjAqG cH0+DfXk =eWcg -----END PGP SIGNATURE----- --T0R1pqbk4pFMPeTD--