Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4165704pxv; Mon, 5 Jul 2021 15:52:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzItHRVZBmjI7qySRmK/M2j/5ZHRGCmSur8eocI+kuWlldyIFNgC0kogWad6StEsfp9sThG X-Received: by 2002:a05:6402:1911:: with SMTP id e17mr18663411edz.36.1625525534133; Mon, 05 Jul 2021 15:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625525534; cv=none; d=google.com; s=arc-20160816; b=FBG03jnn/L8FGuGYqF7cfkkvAxqfCi5zgBqrrZ+AHY+musnX8WJlPgv0kBLOz/EBHw DR3VbOyzJwpwrvw2sySwMg1aPWYTHbFuEHtBQeQp8j2vbJtIEcD2MMZW3jX9Vmq1gVV4 IaKRXSryzx2JccyzZ7NROCDPzetR/KJ/og6UXjTRi7dfwR3jN8yVWXkeaT0bD1OmwOfW dnB8BYpnkBxEiD1L5tXmeV5Br64GHRzFy3z7aojNsMlnHBw5coe6Tj7U9mBXhSDxI6xY LcGd/dG1jpvLBW+0MjUNlxSlIsFB1N+r6wWvy6C0BJ9RCtnySZ5hq1rXKy3A+wakIvuJ /HsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=e9yVK/sW9LN8mETUACWTA4jEhfITQhCRO4/yzLSGpFU=; b=0iXiDmZxK//dgl8mscnHV5ONPadS3h4jTb/eafUZxwlybAJM+lCmsQiucIThc2Nl4p tzJxDX5iad81RVq6km9moAMwrfKIX/OgsiiFsGd0DOjkTn57fKKrrXKGBvPX5V4zIb/Y gwVZrlXS3+F/qVgjylE0ZFfDTjiKyhjdEqsLweAeBwa4MiufTeHBGxD+fI7H9qIGBClw eXJwCnsNtMeNAT4CUu2kYuvtaXkCTqMFYeuWYBlBjpSqxslJF+fIFMWwkQgPUggtqURW 4d42re2EQe6r0F/6QeszH27D6TEQyC416fZ7HkC4E0CKIqPyCBPOxiXFK6nBzScvq+YM Ul8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lw3wt+d7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ox26si2810489ejb.628.2021.07.05.15.51.49; Mon, 05 Jul 2021 15:52:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lw3wt+d7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231623AbhGEWvr (ORCPT + 99 others); Mon, 5 Jul 2021 18:51:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:33566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230086AbhGEWvr (ORCPT ); Mon, 5 Jul 2021 18:51:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ECCBB6186A; Mon, 5 Jul 2021 22:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625525349; bh=mkfPMjkHVZE0n14BdJf3P80AOd+hrM+UUpZI+nANjwc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lw3wt+d7NhPeCSzYclWsItQ6S7mi3EaCuEacBxCewmMfWc7MsoTUbQXJudjA8tVDb GtzHGzyFiUgTUq7MqJjYbWYPgL66aDXAtCgQLpX4EdU/JuwghySeMQyG2baEHOPrWz ncj7fvfhl5mBd/DDMDdhbbw0K54qHEY+1VbFmojQpnJriIQl8NTBVM4qJqxca+TJg6 NXTqorK8W6ICOZQdbDjXGiZajpy2XH8jEy5qnF32se9Y9HnlZFJaD0R7ZuTQLctK3y 55l0Ts5j+/Z5uiobJvrHZ821RCEacu+xBLHRcgnGcoIov8W70hTFy2AKhubt3fDNHV FESEO8VY3n09w== Date: Tue, 6 Jul 2021 06:48:39 +0800 From: Gao Xiang To: Matthew Wilcox Cc: linux-erofs@lists.ozlabs.org, LKML Subject: Re: [RFC PATCH 2/2] erofs: directly traverse pages in z_erofs_readahead() Message-ID: <20210705224822.GA17518@hsiangkao-HP-ZHAN-66-Pro-G1> Mail-Followup-To: Matthew Wilcox , linux-erofs@lists.ozlabs.org, LKML References: <20210705183253.14833-1-xiang@kernel.org> <20210705183253.14833-2-xiang@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matthew, On Mon, Jul 05, 2021 at 09:15:26PM +0100, Matthew Wilcox wrote: > On Tue, Jul 06, 2021 at 02:32:53AM +0800, Gao Xiang wrote: > > In that way, pages can be accessed directly with xarray. > > I didn't mean "open code readahead_page()". I meant "Wouldn't it be > great if z_erofs_do_read_page() used readahead_expand() in order to > allocate the extra pages in the extents that cover the start and end of > the requested chunk". That way the pages would already be in the page > cache for subsequent reads. Yes, I understand that idea. readahead_expand() can be used to cache the whole requested decompressed chunk. Currently, EROFS tends to cache compressed data for incomplete requested chunks instead in the managed inode if cache mode is enabled since LZ4 compressed data is more effective for caching to save I/O than uncompressed data (considering LZ4 decompression speed, which is somewhat like zcache.) For now, EROFS LZMA support is also on the way (but recently I have to work on the DAX support in advance.) LZMA is somewhat slow algorithm but with much better compression ratio. I think it should decompress all requested chunks to save the overall decompression time. So readahead_expand() is quite useful with EROFS LZMA cases, I will investigate it for LZMA-specific cases... BTW, from the patch [2/2] itself, it there some chance to extend readahead_page() or some new API like this? So the original dance can be avoided. Some comments for the iteration behavior itself is always useful, anyway... Thanks, Gao Xiang >