From patchwork Thu Dec 1 07:42:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingbo Xu X-Patchwork-Id: 28222 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp128741wrr; Wed, 30 Nov 2022 23:49:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf7VpfI9EE5qVtY55An/JPRFp91XHEJV2mY/ggXCGrc8a38y1k+Cl+jETopesiz5isa1oBip X-Received: by 2002:a17:903:40c4:b0:188:4f86:e4ea with SMTP id t4-20020a17090340c400b001884f86e4eamr47505034pld.59.1669880982133; Wed, 30 Nov 2022 23:49:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669880982; cv=none; d=google.com; s=arc-20160816; b=fAAaQnmTaby9WxaaSU36JSSuDcQpKlAJ+BT/NV9rsZQ3+nKD+Nc5uo3QpLhpD2zaJh Eh4QVd+8kxVybhWnYYpWh4TIVLvroOMNrNLJwtw/9rZSMSNwVKwLknHzESFjh79TW8mL VD5IV9AkFL8ZaWfVl2gWcMWt+gF2Pl23DMLrPEvjI3GPjwvNBRfu3FjmST96O69eFhT4 jT3Y6Je1fG2uhpxDT2f2v+tdqrprxLwLRxLW2wQ8brQnsg4WXaKcd/HgTqtCLDvomzoi wtFo3wgCp9G3X07EzNMf2ya1YRaIbQXm4paJKEU94T+AsGlNor2S9WdtRaxi5Y7BrEi2 XEvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fL+P4gWZUOAkNDSuK23fCdpGv1b4/G5tDX6qARYHn5s=; b=XlK1KZLeIyGN+HbrC1cOfQHUGuUvUYkj6dg+k8ijOAVTdH9fD5xh8gC8MC2B/OKS/P r8rHl8bIk/UVBSI0rFdlyrX19nG18q3KCuyVly6K74LnffrylxWQIa/aI0mQFIkyIhkU C0DBE+vKRML10wNLVfpnQDrD+ozaLjSoHdJlLRBfpczS4grx9KrHBsX2O3HKsszim1ZO XLyy0jlOzZlFwpwSa/kQvOAgwIvMl/mhiGpHh5Bwa45KrGWWsLDLHy4V+mWjZsoHvaKS zUAzfkwXtfxSAnHbR6uMuaF1IyiF4EESDp63tWLndFR4uw2wiPfkJRM4LKWm+WCZ9zmM qiDA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020a170902d50400b0017efeb31274si4188854plg.507.2022.11.30.23.49.29; Wed, 30 Nov 2022 23:49:42 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbiLAHnL (ORCPT + 99 others); Thu, 1 Dec 2022 02:43:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbiLAHnD (ORCPT ); Thu, 1 Dec 2022 02:43:03 -0500 Received: from out30-1.freemail.mail.aliyun.com (out30-1.freemail.mail.aliyun.com [115.124.30.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E700718392 for ; Wed, 30 Nov 2022 23:43:01 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0VW7ouC6_1669880578; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VW7ouC6_1669880578) by smtp.aliyun-inc.com; Thu, 01 Dec 2022 15:42:59 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v4 2/2] erofs: enable large folios for fscache mode Date: Thu, 1 Dec 2022 15:42:56 +0800 Message-Id: <20221201074256.16639-3-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20221201074256.16639-1-jefflexu@linux.alibaba.com> References: <20221201074256.16639-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750997120871852674?= X-GMAIL-MSGID: =?utf-8?q?1750997120871852674?= Enable large folios for fscache mode. Enable this feature for non-compressed format for now, until the compression part supports large folios later. One thing worth noting is that, the feature is not enabled for the meta data routine since meta inodes don't need large folios for now, nor do they support readahead yet. Also document this new feature. Signed-off-by: Jingbo Xu Reviewed-by: Jia Zhu --- Documentation/filesystems/erofs.rst | 2 ++ fs/erofs/inode.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/filesystems/erofs.rst b/Documentation/filesystems/erofs.rst index 82af67fdaf99..1c1f7404b338 100644 --- a/Documentation/filesystems/erofs.rst +++ b/Documentation/filesystems/erofs.rst @@ -72,6 +72,8 @@ Here are the main features of EROFS: - Support merging tail-end data into a special inode as fragments. + - Support large folios for uncompressed files. + - Support direct I/O on uncompressed files to avoid double caching for loop devices; diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index e457b8a59ee7..85932086d23f 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -295,8 +295,7 @@ static int erofs_fill_inode(struct inode *inode) goto out_unlock; } inode->i_mapping->a_ops = &erofs_raw_access_aops; - if (!erofs_is_fscache_mode(inode->i_sb)) - mapping_set_large_folios(inode->i_mapping); + mapping_set_large_folios(inode->i_mapping); #ifdef CONFIG_EROFS_FS_ONDEMAND if (erofs_is_fscache_mode(inode->i_sb)) inode->i_mapping->a_ops = &erofs_fscache_access_aops;