Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp8146202ioo; Sat, 4 Jun 2022 00:35:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz09ozn4klTHuaX5lq/2Q2+xPmteMKQmID+9VVaXYq28NgBeeZusiEJDNq8xilItI+EbS/r X-Received: by 2002:a05:6402:d05:b0:425:b5c8:faeb with SMTP id eb5-20020a0564020d0500b00425b5c8faebmr15046833edb.273.1654328159311; Sat, 04 Jun 2022 00:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654328159; cv=none; d=google.com; s=arc-20160816; b=v0S5qqsOJxWUrvICoPJilXoOcVBGozJhRFJEgfauRQqFvxjmmOzGS8zR6RPJ8OKXGX urlm4I4FcfCeAKMIn5/ioM8j0X4Do05dZDSAUvlOKA/BioEcw3PXLsuOditAioBANV0J MrcgmXOad/23KuX6wb+Xn6t2IDgl4a8wJcG8o3rbj1/fVV5qM2Pqi+/jfgjSW+BMcjQN XwT7X3s2GEa1dCzzCvoYClChNrT4iWP2Hv5V33kUrOiRWK5nISKuDweTIJ3l9o1R82V8 1NrAF9GvGyXzC3kUkrQFMPp4wI5+Ez9CoBwZwEXDgKFrYuuB2NOYACB9daWL2oHA4c8i 8jZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qkeHRBdl081MDBZtrAPApzGYGIh1KENS5YX5qLHLvrk=; b=wKzDX82EaVPNWiTuP6rINVZDCMPDOvxHO5vfCuXJguj/IjJuj/21BTgnLmicv7+J9a 6UtShJwtDFSIMhjxI46E/Rd3sfk3O50ykiED74I7hlZLWTTuqGiQXVqvdRGtxixWZ8En 88QqMQl5as+NnTT7VvupYZKG+eKY3HaYHrpoen8E9gV+G8JFqRmfJXgx1diotGa20a+e fiM7tziQDP8uFFIUaQmkpW6nV/NoPADpl9TR8aAZHTJv06/VkGsEU8Pif666H2qPXVXA 3I2sardFPI6eIBT3YqDgzdzGk+rvZ3BnasizzAxVPllKewFot18LtpcOXkTkIjgcJJHb 0+eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nAsmKW3C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd39-20020a17090796a700b00710a459161asi1900659ejc.960.2022.06.04.00.34.52; Sat, 04 Jun 2022 00:35:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nAsmKW3C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241360AbiFCPaQ (ORCPT + 99 others); Fri, 3 Jun 2022 11:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239376AbiFCPaN (ORCPT ); Fri, 3 Jun 2022 11:30:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 742A012608 for ; Fri, 3 Jun 2022 08:30:12 -0700 (PDT) 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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().