Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3535545pxb; Mon, 4 Apr 2022 20:18:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHYHOL8VPHE3B9fkpYkM3L1+G8iWBxxYwarWuG/9Ss45epEkjd3VCeQb7dQEtXS35RwbCm X-Received: by 2002:a63:69c7:0:b0:380:afc8:33be with SMTP id e190-20020a6369c7000000b00380afc833bemr1102124pgc.304.1649128723258; Mon, 04 Apr 2022 20:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649128723; cv=none; d=google.com; s=arc-20160816; b=pvXWMZ1avosHFTNxl9hah20bRAw8m67ZVRj2PzJ4169OPVLNKhNEF16zjtIxG7AaDW I0kyDOQfyEI0P35OxJkudFRn4MaFJqg6bCm+QnwbCBiyu91r8UOw9ml7pUN0Z7xsiPuf MpwKVCRd/7YDuPo4nnVDu0rX7mlfg/zj71vRvD1sjsETd0pjohUOi6/ZylL0aZhlzsLo Z951DnjJ4OfpZ1LscdxOew7eiBL9K227LchmOJbG9cXByr/k6JkEJURBNYQhXEb5ABzQ JdIIeTGfqiQBkUjlKF9MP5EhZxJ8WgvwNZuJi8vf8Nw8zaSy+dtcA0zpCgtIqBzMZiCD er6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=wyBisBxZPrTILZULgjdjxrHahw1/KZ62IWV/yfcHbXw=; b=axy5A6e7wOQaUNfOribmx0ga6VDEZ3hAHnCySbdZGDVHNoAbM8hVZAXcSHeptWKibP Nlx1Sqybjae7QLyUot7Av+N/D7XhoOGU7J98YEVYJUpFllp2b++D1Y8n5VS09WQe60pK TsE7aYCJQ7Nq3WdpcpKkfnW4ppQkbSxkgPEjYTBSNL5vX85D0GxacyC0BwMf5bfPJ4vj 5NxhARQ9QUYsCGnyxOwlYZDEhWvtGDH14i9nTV/HKqU1vSp8CStghikjmLSfi60CjOVO qwl83PctMJnqOaF9rDEPBV18spileOpMwTH8eVulcV3lyi6d0pObgIad7swkc65knbtG PD+g== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t1-20020a1709027fc100b00153b2d16541si10760411plb.329.2022.04.04.20.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 20:18:43 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6036B25DEEA; Mon, 4 Apr 2022 18:18:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381868AbiDDVYO (ORCPT + 99 others); Mon, 4 Apr 2022 17:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380689AbiDDVBX (ORCPT ); Mon, 4 Apr 2022 17:01:23 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9A1538A3 for ; Mon, 4 Apr 2022 13:59:26 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1nbTnI-0004FN-Ih; Mon, 04 Apr 2022 22:59:24 +0200 Message-ID: <5f862219-2e48-72d0-af27-3ab2b5820a95@pengutronix.de> Date: Mon, 4 Apr 2022 22:59:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: Possible performance regression with CONFIG_SQUASHFS_DECOMP_SINGLE Content-Language: en-US To: Phillip Lougher Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org, squashfs-devel@lists.sourceforge.net, phillip.lougher@gmail.com References: <20220316053428.5758-1-phillip@squashfs.org.uk> From: Ahmad Fatoum In-Reply-To: <20220316053428.5758-1-phillip@squashfs.org.uk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Phillip, On 16.03.22 06:34, Phillip Lougher wrote: > Ahmad Fatoum wrote: > >> Hello, >> >> This an issue we had with v5.15 that we have since successfully worked around. >> I am reporting it here as a pointer in case someone else runs into this and as >> a heads up that there seems to be an underlying performance regression, so >> here it goes: >> > > [snip] > >> >> Looking through the original kernel configuration we found that it has >> CONFIG_SQUASHFS_DECOMP_SINGLE=y and CONFIG_SQUASHFS_FILE_CACHE=y. >> >> Once changed to CONFIG_SQUASHFS_FILE_DIRECT=y and >> CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y, we were below 40s as we want. > > This sounds like the slow-down that was introduced by commit c1f6925e1091 > "mm: put readahead pages in cache earlier" (Linux V5.8) > > This commit prevents Squashfs from doing it's own readahead, which > causes a slow-down in performance. The slow-down is noticable when > using a single decompressor (CONFIG_SQUASHFS_DECOMP_SINGLE=y), and > can be solved by moving to a multi-decompressor configuration, because > it removes contention on a single buffer in the single decompressor case. > > This has been already been fixed by commit 9eec1d897139 > "squashfs: provide backing_dev_info in order to disable read-ahead" > which is in Linux 5.17-rc1. I just updated to v5.17.1 and I can confirm that this commit fixes the performance regression. Single decompressor case is now nearly as fast as multi decompressor. Reverting the fix increased boot time from 30s~ to 2min30s. Thanks for clearing this up! Cheers, Ahmad > > Phillip > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |