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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5866C433EF for ; Fri, 3 Jun 2022 15:29:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 18C8F8D0003; Fri, 3 Jun 2022 11:29:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1175D8D0001; Fri, 3 Jun 2022 11:29:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF3F18D0003; Fri, 3 Jun 2022 11:29:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id DF95C8D0001 for ; Fri, 3 Jun 2022 11:29:54 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id BCEB1121513 for ; Fri, 3 Jun 2022 15:29:54 +0000 (UTC) X-FDA: 79537309908.01.71B2C62 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP id 5E07D4007D for ; Fri, 3 Jun 2022 15:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qkeHRBdl081MDBZtrAPApzGYGIh1KENS5YX5qLHLvrk=; b=nAsmKW3CDG6cFmCfkkE5LVu6HE FNJ9U5jlkN+wIaijymvGC3pX0hnBhsHJ1wfPHVw32iDumMlRuXvlAi5W+lHx3yVsd+hNqXFoWwoXm +jBL5bfqte7c7RmIRemY+lzkQj7DkB+tZGyhY0D4g2Se1aHVWhTzReUE1UrpqHLr29TZCffXmvSRI qXl7L/F0zAz0AkutWD/MlZ/W8YnGfLIhxxNrmr8XgrERhPXkWp4hENrBIHuDsI6wF7weQRKBB0Nw4 c2tQOvsN1skTlRhOO1SMvh2OA7XP7yLPIzjj7mSuznEXbJTqaSZwgHWr/Ln5sFsNRhLAFXczR1Ifg CRPekc0A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nx9F3-007yWV-2u; Fri, 03 Jun 2022 15:29:37 +0000 Date: Fri, 3 Jun 2022 16:29:37 +0100 From: Matthew Wilcox To: Hsin-Yi Wang Cc: Marek Szyprowski , Phillip Lougher , Xiongwei Song , Zheng Liang , Zhang Yi , Hou Tao , Miao Xie , Andrew Morton , "linux-mm @ kvack . org" , "squashfs-devel @ lists . sourceforge . net" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/3] squashfs: implement readahead Message-ID: References: <20220601103922.1338320-1-hsinyi@chromium.org> <20220601103922.1338320-4-hsinyi@chromium.org> <90b228ea-1b0e-d2e8-62be-9ad5802dcce7@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: t15uwhs9oe86tzjh36gq3pzcbdigyhkb X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nAsmKW3C; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 5E07D4007D X-HE-Tag: 1654270150-626132 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jun 03, 2022 at 10:55:01PM +0800, Hsin-Yi Wang wrote: > On Fri, Jun 3, 2022 at 10:10 PM Marek Szyprowski > wrote: > > > > Hi Matthew, > > > > On 03.06.2022 14:59, Matthew Wilcox wrote: > > > On Fri, Jun 03, 2022 at 02:54:21PM +0200, Marek Szyprowski wrote: > > >> On 01.06.2022 12:39, Hsin-Yi Wang wrote: > > >>> Implement readahead callback for squashfs. It will read datablocks > > >>> which cover pages in readahead request. For a few cases it will > > >>> not mark page as uptodate, including: > > >>> - file end is 0. > > >>> - zero filled blocks. > > >>> - current batch of pages isn't in the same datablock or not enough in a > > >>> datablock. > > >>> - decompressor error. > > >>> Otherwise pages will be marked as uptodate. The unhandled pages will be > > >>> updated by readpage later. > > >>> > > >>> Suggested-by: Matthew Wilcox > > >>> Signed-off-by: Hsin-Yi Wang > > >>> Reported-by: Matthew Wilcox > > >>> Reported-by: Phillip Lougher > > >>> Reported-by: Xiongwei Song > > >>> --- > > >> This patch landed recently in linux-next as commit 95f7a26191de > > >> ("squashfs: implement readahead"). I've noticed that it causes serious > > >> issues on my test systems (various ARM 32bit and 64bit based boards). > > >> The easiest way to observe is udev timeout 'waiting for /dev to be fully > > >> populated' and prolonged booting time. I'm using squashfs for deploying > > >> kernel modules via initrd. Reverting aeefca9dfae7 & 95f7a26191deon on > > >> top of the next-20220603 fixes the issue. > > > How large are these files? Just a few kilobytes? > > > > Yes, they are small, most of them are smaller than 16KB, some about > > 128KB and a few about 256KB. I've sent a detailed list in private mail. > > > > Hi Marek, > > Are there any obvious squashfs errors in dmesg? Did you enable > CONFIG_SQUASHFS_FILE_DIRECT or CONFIG_SQUASHFS_FILE_CACHE? I don't think it's an error problem. I think it's a short file problem. As I understand the current code (and apologies for not keeping up to date with how the patch is progressing), if the file is less than msblk->block_size bytes, we'll leave all the pages as !uptodate, leaving them to be brough uptodate by squashfs_read_folio(). So Marek is hitting the worst case scenario where we re-read the entire block for each page in it. I think we have to handle this tail case in ->readahead().