From patchwork Sat Jun 11 03:21:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Lougher X-Patchwork-Id: 12878324 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 9BAB3C43334 for ; Sat, 11 Jun 2022 03:22:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE46F8D0100; Fri, 10 Jun 2022 23:22:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C93A58D00FF; Fri, 10 Jun 2022 23:22:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5C588D0100; Fri, 10 Jun 2022 23:22:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A85BD8D00FF for ; Fri, 10 Jun 2022 23:22:56 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7F5C72188B for ; Sat, 11 Jun 2022 03:22:56 +0000 (UTC) X-FDA: 79564508352.04.F7A4674 Received: from p3plwbeout21-05.prod.phx3.secureserver.net (p3plsmtp21-05-2.prod.phx3.secureserver.net [68.178.252.70]) by imf24.hostedemail.com (Postfix) with ESMTP id CBA3318006C for ; Sat, 11 Jun 2022 03:22:55 +0000 (UTC) Received: from mailex.mailcore.me ([94.136.40.142]) by :WBEOUT: with ESMTP id zri8nk5A6da5Yzri9ngHsB; Fri, 10 Jun 2022 20:22:53 -0700 X-CMAE-Analysis: v=2.4 cv=Et0XEQQA c=1 sm=1 tr=0 ts=62a40a8d a=s1hRAmXuQnGNrIj+3lWWVA==:117 a=84ok6UeoqCVsigPHarzEiQ==:17 a=ggZhUymU-5wA:10 a=JPEYwPQDsx4A:10 a=g6NoVSEHmQBr8nN1tTEA:9 X-SECURESERVER-ACCT: phillip@squashfs.org.uk X-SID: zri8nk5A6da5Y Received: from 82-69-79-175.dsl.in-addr.zen.co.uk ([82.69.79.175] helo=localhost.localdomain) by smtp02.mailcore.me with esmtpa (Exim 4.94.2) (envelope-from ) id 1nzri7-0001TR-K0; Sat, 11 Jun 2022 04:22:52 +0100 From: Phillip Lougher To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Cc: willy@infradead.org, hsinyi@chromium.org, Xiongwei.Song@windriver.com, linux-mm@kvack.org, squashfs-devel@lists.sourceforge.net, Phillip Lougher Subject: [PATCH 0/2] Squashfs: handle missing pages decompressing into page cache Date: Sat, 11 Jun 2022 04:21:31 +0100 Message-Id: <20220611032133.5743-1-phillip@squashfs.org.uk> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Mailcore-Auth: 439999529 X-Mailcore-Domain: 1394945 X-123-reg-Authenticated: phillip@squashfs.org.uk X-Originating-IP: 82.69.79.175 X-CMAE-Envelope: MS4xfPjhb50ozjtBOLEeLylJp+sovdiZs6pTU6wQ7jFw0zUSg6OwEDn3oYe5aFxmkvhaQeqhmMJxQBLsvzbk66Nl4QecWdQG2x/FZiyNdPrSUu3dSGBAngMT P+hHEkec75dRFC9SciciVfAsx1c+3ynQLVnfELOItyQchvlfTAJoA1waWmEeqJzGlaQSl+NwNhaNUIcn+4Yu6BrWEGJv0+8fAeI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654917776; a=rsa-sha256; cv=none; b=tAQnUxfz1tDOG5u2yh0yul3Po7eALyEiPIizHlX/rDVHd1H0ptAHUYWkxyB8KqSXaTFugD demS9O2vqiSSAqGn3AEhRBXNPb96+tXtFrxhpnTj7h80yFwDrogv4vOr898mUo8b4H+uqu eQSjZFrou7Ai0E8NC4YbiQZOD9UDq4s= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; spf=none (imf24.hostedemail.com: domain of phillip@squashfs.org.uk has no SPF policy when checking 68.178.252.70) smtp.mailfrom=phillip@squashfs.org.uk; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654917776; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=JJqaW036fSE7ahDdvjFne/NbG1L7oTjPNbmy/zkpQHo=; b=29fZYFNS/5okOPvoNsOOETo/V7mz7UvNdYRuzMMY+MMmK0z1+SZkueesS18W7mjKg3G91l c1xu1h7mEJakD3CcaTsi/fBGsxc3QELI2coo/MDmmhZQXVRkDVDTdEdns5Fpo5thSReEZH 99NOuAyM70E49Wm4gIHbVSBNV0UryY4= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: CBA3318006C X-Stat-Signature: tqx5odmxmbyepekkbaz1u368gd6icw97 X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=none; spf=none (imf24.hostedemail.com: domain of phillip@squashfs.org.uk has no SPF policy when checking 68.178.252.70) smtp.mailfrom=phillip@squashfs.org.uk; dmarc=none X-HE-Tag: 1654917775-294284 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 all, This patch-set enables Squashfs to handle missing pages when directly decompressing datablocks into the page cache. Previously if the full set of pages needed was not available, Squashfs would have to fall back to using an intermediate buffer (the older method), which is slower, involving a memcopy, and it introduces contention on a shared buffer. The first patch extends the "page actor" code to handle missing pages. The second patch updates Squashfs_readpage_block() to use the new functionality, and removes the code that falls back to using an intermediate buffer. This patch-set is independent of the readahead work, and it is standalone. It can be merged on its own. But the readahead patch for efficiency also needs this patch-set. Phillip ---------------------------------------------------------------- Phillip Lougher (2): Squashfs: extend "page actor" to handle missing pages Squashfs: don't use intermediate buffer if pages missing fs/squashfs/block.c | 10 ++++-- fs/squashfs/decompressor.h | 1 + fs/squashfs/file_direct.c | 90 +++++++++++----------------------------------- fs/squashfs/lz4_wrapper.c | 7 ++-- fs/squashfs/lzo_wrapper.c | 7 ++-- fs/squashfs/page_actor.c | 67 ++++++++++++++++++++++++++++------ fs/squashfs/page_actor.h | 17 +++++++-- fs/squashfs/xz_wrapper.c | 11 +++++- fs/squashfs/zlib_wrapper.c | 12 ++++++- fs/squashfs/zstd_wrapper.c | 12 ++++++- 10 files changed, 142 insertions(+), 92 deletions(-)