Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp263418rwb; Thu, 10 Nov 2022 00:01:35 -0800 (PST) X-Google-Smtp-Source: AMsMyM4grPYEOpd8oQqzfyJt6uaSVsx5tk3nRJEkQigaIoOUHuRSA/Q40oGP920fvCnsbg5FlHan X-Received: by 2002:a17:907:d08f:b0:7ae:3565:49e8 with SMTP id vc15-20020a170907d08f00b007ae356549e8mr2191406ejc.761.1668067295228; Thu, 10 Nov 2022 00:01:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668067295; cv=none; d=google.com; s=arc-20160816; b=RYZ6kYcw4wl0AX07a3ity0ooTXfK8jQ2hFBN180eUIhYRj9LAV0GRrtHhm/rWOcOR5 mqdMansfGpkxRES+PC0GYHn1ObPPPyxs4QLhkZY2At5w+QVqpxdG7S0kzK0QxppfhySx GuGi265J4ohQHXdhUirykcekTMhd2Ji3dFX1mIOAaOdDUQWgKqcZE5cb4cQbAE7x12Xu AdMCycicUCoMKcpyDOGJfkygJadJ2GyWUAQ8ZZXn2ufCzyXcG/EuPdItiSGxr+vFruWn PPkvYhC1/mBfTKHWV7Th6fO+QlUC3a9ptVnilI/pN8uOYcq8XYpdM1Jn86fBIQiDdXAC ZnVg== 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 :message-id:date:subject:cc:to:from; bh=6gAtJn+rrZO7yTxAsYwJrcjDwvAff8zwin77fe8TAX4=; b=dF0bVn2vvi7L0prmfOGqBGoj9HrI5k9CDFs2HCmxwqkFITRQKJBJQrofY7rxNME3Re 2XmBJjywDMgIRpEIC2+yxpo9gRfzuCyGeVTfdgYQ3eMGrbEDA3XAojLiU/Mw2MyhI1/I B3liRggU2+b93/4AS51Sh4scVCOyqPjrPkpIvQtbONel0b5x4z8pKmcBwxFeSyP2DguZ e/835oYJrRKrdXMW16EMfBrURgmOrBThxWoGXtijbzEWFNr1ze6Cg4KWjD/7DWFFJwmL DsTkPHj+BUVoX/2RUk44JAkYoSm4YCncHJkc+EwofJ4Hs08WJEr6gv1P1QyXL+CGRBtD jMkw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u17-20020a50c2d1000000b0045beaf03ddesi15663253edf.411.2022.11.10.00.00.44; Thu, 10 Nov 2022 00:01:35 -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 S230117AbiKJHka (ORCPT + 92 others); Thu, 10 Nov 2022 02:40:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbiKJHk2 (ORCPT ); Thu, 10 Nov 2022 02:40:28 -0500 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B799E615F for ; Wed, 9 Nov 2022 23:40:26 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R561e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VURxxwo_1668066023; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VURxxwo_1668066023) by smtp.aliyun-inc.com; Thu, 10 Nov 2022 15:40:24 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: huyue2@coolpad.com, linux-kernel@vger.kernel.org Subject: [PATCH] erofs: enable large folio in device-based mode Date: Thu, 10 Nov 2022 15:40:23 +0800 Message-Id: <20221110074023.8059-1-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,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 Enable large folio in device-based mode. Then the radahead routine will pass down large folio containing multiple pages. Enable this feature for non-compressed format for now, until the compression part supports large folio later. Signed-off-by: Jingbo Xu --- I have tested it under workload of Linux compiling. I know it's not a perfect workload testing this feature, because large folio is less likely hit in this case since source files are generally small. But I indeed observed large folios (e.g. 16 pages) by peeking readahead_count(rac) in erofs_readahead(). --- fs/erofs/inode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index ad2a82f2eb4c..e457b8a59ee7 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -295,6 +295,8 @@ 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); #ifdef CONFIG_EROFS_FS_ONDEMAND if (erofs_is_fscache_mode(inode->i_sb)) inode->i_mapping->a_ops = &erofs_fscache_access_aops; -- 2.19.1.6.gb485710b