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 0541CC43334 for ; Fri, 3 Jun 2022 15:59:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 643E08D0001; Fri, 3 Jun 2022 11:59:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F5D76B0072; Fri, 3 Jun 2022 11:59:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 441328D0001; Fri, 3 Jun 2022 11:59:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2E6A86B0071 for ; Fri, 3 Jun 2022 11:59:05 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id DFB6335E00 for ; Fri, 3 Jun 2022 15:59:04 +0000 (UTC) X-FDA: 79537383408.20.84105DF Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by imf06.hostedemail.com (Postfix) with ESMTP id 94DA618004A for ; Fri, 3 Jun 2022 15:58:59 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220603155901euoutp01fb23bd3f88a7b9c2dfe2bcbe956e33e9~1J5DwvVhn0911809118euoutp019 for ; Fri, 3 Jun 2022 15:59:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220603155901euoutp01fb23bd3f88a7b9c2dfe2bcbe956e33e9~1J5DwvVhn0911809118euoutp019 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1654271941; bh=Y2ntu47kCMtNZvS3cwLiwDSyZbHLNNAFAlZXcops+c0=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=K630aHoovKfJJUj1i64FtB/CMRsDtGwUpCZ5hjA7lnW3ZeK+iLiwW0eeS5NhvhCGB MFytSbpCflNvXeI9qwhUWH41Whhqw98TcIwMyEktUjVyF7U3mKssW6sCclMPlp1+9Q ++ouNPyZuWqqyHsCMHUzZEBVFVwOEKd0/z+iAQIM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220603155901eucas1p131dfecd7103cfb770788876db51817a6~1J5DTSKHW1817318173eucas1p17; Fri, 3 Jun 2022 15:59:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id D7.60.10067.4CF2A926; Fri, 3 Jun 2022 16:59:00 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20220603155859eucas1p1857158e8524df567437c2b62590cd86a~1J5B86fi82553725537eucas1p1x; Fri, 3 Jun 2022 15:58:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220603155859eusmtrp1d45d04e83a1350a0a40e874b322372c5~1J5B8LSEu1938219382eusmtrp1D; Fri, 3 Jun 2022 15:58:59 +0000 (GMT) X-AuditID: cbfec7f4-dd7ff70000002753-7b-629a2fc49959 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DB.7A.09038.3CF2A926; Fri, 3 Jun 2022 16:58:59 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220603155858eusmtip2c1095376f5b0d975e230c4ce4bff40e9~1J5BJHPed2407024070eusmtip2Z; Fri, 3 Jun 2022 15:58:58 +0000 (GMT) Message-ID: Date: Fri, 3 Jun 2022 17:58:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v4 3/3] squashfs: implement readahead Content-Language: en-US To: Matthew Wilcox , Hsin-Yi Wang Cc: 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 From: Marek Szyprowski In-Reply-To: Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGKsWRmVeSWpSXmKPExsWy7djPc7pH9GclGSz7bm0xZ/0aNotNh96w WUxo3c5scXnXHDaLe2v+s1p0rLzHanG0ZzObxdVd9Ra/fwDFP+16z2px7d0ZNovvDzYzOfB4 zG64yOLRcuQtq8fmFVoemz5NYvc4MeM3i8fuBZ+ZPKZ8fc7s8XmTnMf6LVuZAjijuGxSUnMy y1KL9O0SuDJW/J/IXDBVsqKx7xBjA+NekS5GTg4JAROJDzP+snYxcnEICaxglHh6fw0jhPOF UWLpt41Qmc+MEt87XrLBtPyZcIMdIrGcUeLB8gvMEM5HRokJl9qZuhg5OHgF7CRW9KuANLAI qEhs+/2FBcTmFRCUODnzCZgtKpAkMX9bKyuILSxgKfFg13JmEJtZQFzi1pP5TCC2iICPxLMZ a8CWMQtsYZaY1jYXrJlNwFCi620X2EWcQBd1v9zHCtEsL9G8dTbYQRIC8zkl1nTeZgc5SELA ReL7Al+ID4QlXh3fwg5hy0icntzDAlGSL/F3hjFEuELi2us1zBC2tcSdc7/YQEqYBTQl1u/S hwg7Sqxf/pkJopNP4sZbQYgD+CQmbZvODBHmlehoE4KoVpOYdXwd3M6DFy4xT2BUmoUUJrOQ /D4LySuzEPYuYGRZxSieW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gvJwllIWmYhaVnAyLKKUSS1tDg3PbfYSK84 Mbe4NC9dLzk/dxMjMJq3Hfu5ZQfjylcf9Q4xMnEwHmKU4GBWEuEtmzczSYg3JbGyKrUoP76o NCe1+BCjKTA0JjJLiSbnA9NJXkm8oZmBqaGJmaWBqaWZsZI4r2dBR6KQQHpiSWp2ampBahFM HxMHp1QD07zi57OLK/rSve2ifv37VfWvefe1+F8WHeuP9h+2Zr8xyXKB1OHTih1TYo9tqXJw niHTPaVY4E6A7D/hGx+3nndc3vxg86vF0/XuLm6dvWzB6sYex/QrbtsnKwefi5C9LBvCw1RT 8eHoR5vt5rzp3Jf6OpmW7/v7lt3PRSrp44p3gQ++Mh41/rZO48nsts++95wX1x8LWMslzf9n s7QQU+QKqcQvxQm6hstm7rlts/eBm+tkkw0GOrNen9n4yCfLU63AYpK1hJrZHvWAlL/z57pK FlmoaLLXaqjI3bj0MfTN1QAFu55ji/r7T1h6HotcaHL9/XKLy3Hurvtbqu1Tfby2neF9Ld49 dYlocWPsDyWW4oxEQy3mouJEAFHs1FtvAwAA X-CMS-MailID: 20220603155859eucas1p1857158e8524df567437c2b62590cd86a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20220603125421eucas1p17da286a3e7f2d4759aa4c7639dd62f75 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220603125421eucas1p17da286a3e7f2d4759aa4c7639dd62f75 References: <20220601103922.1338320-1-hsinyi@chromium.org> <20220601103922.1338320-4-hsinyi@chromium.org> <90b228ea-1b0e-d2e8-62be-9ad5802dcce7@samsung.com> X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 94DA618004A Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=K630aHoo; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf06.hostedemail.com: domain of m.szyprowski@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=m.szyprowski@samsung.com X-Stat-Signature: jwczqxoszpnc5mo8ei5oj95gn4pmnrqb X-Rspam-User: X-HE-Tag: 1654271939-379530 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: Hi Matthew, On 03.06.2022 17:29, Matthew Wilcox wrote: > 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(). I'm not sure if this is related to reading of small files. There are only 50 modules being loaded from squashfs volume. I did a quick test of reading the files. Simple file read with this patch: root@target:~# time find /initrd/ -type f | while read f; do cat $f >/dev/null; done real    0m5.865s user    0m2.362s sys     0m3.844s Without: root@target:~# time find /initrd/ -type f | while read f; do cat $f >/dev/null; done real    0m6.619s user    0m2.112s sys     0m4.827s Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland