Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1937307pxk; Sun, 13 Sep 2020 23:23:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyniYx5Ekwj3fKorXIrRjg5ykjx99NW842KZ72suLhXirK73WdIVYUWAAXV5DbVv01jXc1b X-Received: by 2002:a17:906:3088:: with SMTP id 8mr1885978ejv.487.1600064617560; Sun, 13 Sep 2020 23:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600064617; cv=none; d=google.com; s=arc-20160816; b=aXNBzhAY0lBkv8aYmnVmU3VPWbp6V1G4ZuHIrXIZje/eMN5+de5AQBknYsLimtCIcw jLNpUbA81sv6Nw17WH79C2sI6SGJrDn71f+AfrhL2jG3+wH6DuQtCZZEZ2Y0MGuowP6j vEDOi5saE3JHr4my0GXVijzrDiVPZDEwis5739ExPKpHvBMfqS7SnKl/RNljB1YQ4B6v /bDC5YBaA0bA2LWLNIsZOSrSJevPf9PGZah/IxLnMmoj6t8NrHqdyY2dewfRJ7pC9YZl VOAK0E4tQDZ2lnYt3akQBC57SNVWtMTgwU+8EIVN8jzrNO5APLxhWHmmS6oC88hXK+Fj NyVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OPWNvv2kZKctpbCV5DaDmYimW34Kcud5VzQfi7Xnkyc=; b=zy8jsFXiUWxrs+7LQNYCrmQSekLcNdctGJn5HleCnSzksum5gi+qfcIFsaFtoEKBUV +B+/R7zKP41PnJYyO1acqbKWPC3rf2D12exBg7WEuhxKclxlsDF9czBWRT4c9NT06kP6 wUWxEojM9tXnKQeQKJYgMfKRgrAO/+c0pscIoxwtr3OoMIfVpIoWAAHKwMdj+1KAxemN FusA6QjjGbcvVIApnu+sNeprvgU9oNABp7nswe1W5hRfWSe/kunXsFA4R1FqiFCKwkz+ IkjdRpXh0txDVx9hA7ixqn6chXH7NDaR8NtoUXHqw5M7iemk30fJO+m8V3525zOIrUxA gkqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@malat-biz.20150623.gappssmtp.com header.s=20150623 header.b=a0bp8QrN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si7344943edj.40.2020.09.13.23.23.15; Sun, 13 Sep 2020 23:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@malat-biz.20150623.gappssmtp.com header.s=20150623 header.b=a0bp8QrN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726043AbgINGUC (ORCPT + 99 others); Mon, 14 Sep 2020 02:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbgINGT7 (ORCPT ); Mon, 14 Sep 2020 02:19:59 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA005C06174A for ; Sun, 13 Sep 2020 23:19:58 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id q13so21453107ejo.9 for ; Sun, 13 Sep 2020 23:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=malat-biz.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OPWNvv2kZKctpbCV5DaDmYimW34Kcud5VzQfi7Xnkyc=; b=a0bp8QrNiHY/XDpAKBCEXGpK4nesHUgOvIqiaHQ/49/zhPg9G9bMJrl+0kD50tu+BN zJrhlnPXT9LQNjSyVwOF1BZfFMxS7aHAjONIckGM6ssXdV3xR90WKRKmVT72QtMoTHc5 02iM0zN1sJIwCCHo00jljpmXWbsNYB1LrZA778IywvEN1oU+aVNoYoqLerxRreONkIXw 7LRwUVGoaOE6L+exYogI4sgqyVR7GbOcnDT9DPb4gAzPBN+vCF80pMrCQZvhPCRZRbiH lIxhT9AhuugbMOrH4k144DA2+LivRf9UzfcU+EzCq8nStJ27d8jHjG1G7F/vJEap2AUw PSGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OPWNvv2kZKctpbCV5DaDmYimW34Kcud5VzQfi7Xnkyc=; b=Vh3zYMg4J2tDpExHULf7Y1dwPEI99zvllC21tse1bWP8J2gAVdoNgPObaMEHlyVuBk vxDFZ2f97sJtGgroCyFopIe5RGakoTsr3xopPj/1rIpU8y9glwuWtsCgUjGi/Kyjo5c9 pgDI/Zm/RbY6+iVplxFMFdT9pBeDAJgyn3SRBDn4aVSa+OkbJWFZbNedKEwQNF/L/XV9 tgcM3LTSEwqB5sg5gUDyXQUZOdu97HHbpIJ2tbQ6kKwRlohAAEhcxXqFIvoH97aNKgdr Q6+GGrHMRuDxMm2sydtQ1d+tgJ1CC6yZHZXaFGTa3mbUUI5x5Ngs7x/DI7IolSOSsF2M /sbA== X-Gm-Message-State: AOAM532GZa/xxWb45nRfwUJrFDYGBCVw4AIsHpOFQXsmaIBebj4XYdk+ /bd4UcVkeEf6gDkR9vMwUUWj7R8Ef1kfZg== X-Received: by 2002:a17:906:914b:: with SMTP id y11mr13608778ejw.145.1600064396976; Sun, 13 Sep 2020 23:19:56 -0700 (PDT) Received: from ntb.Speedport_W_921V_1_46_000 (p5b363350.dip0.t-ipconnect.de. [91.54.51.80]) by smtp.googlemail.com with ESMTPSA id p12sm7024641ejb.42.2020.09.13.23.19.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 23:19:56 -0700 (PDT) From: Petr Malat To: linux-kernel@vger.kernel.org Cc: nickrterrell@gmail.com, gustavoars@kernel.org, Petr Malat Subject: [PATCH] zstd: Fix decompression of large window archives on 32-bit platforms Date: Mon, 14 Sep 2020 08:19:31 +0200 Message-Id: <20200914061931.21886-1-oss@malat.biz> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It seems some optimization has been removed from the code without removing the if condition which should activate it only on 64-bit platforms and as a result the code responsible for decompression with window larger than 8MB was disabled on 32-bit platforms. Signed-off-by: Petr Malat --- lib/zstd/decompress.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/zstd/decompress.c b/lib/zstd/decompress.c index db6761ea4deb..509a3b8d51b9 100644 --- a/lib/zstd/decompress.c +++ b/lib/zstd/decompress.c @@ -1457,12 +1457,8 @@ static size_t ZSTD_decompressBlock_internal(ZSTD_DCtx *dctx, void *dst, size_t d ip += litCSize; srcSize -= litCSize; } - if (sizeof(size_t) > 4) /* do not enable prefetching on 32-bits x86, as it's performance detrimental */ - /* likely because of register pressure */ - /* if that's the correct cause, then 32-bits ARM should be affected differently */ - /* it would be good to test this on ARM real hardware, to see if prefetch version improves speed */ - if (dctx->fParams.windowSize > (1 << 23)) - return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize); + if (dctx->fParams.windowSize > (1 << 23)) + return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize); return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize); } -- 2.20.1