From patchwork Thu Nov 10 07:40:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingbo Xu X-Patchwork-Id: 17999 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp6469wru; Wed, 9 Nov 2022 23:59:29 -0800 (PST) X-Google-Smtp-Source: AMsMyM7SFe4tzsQ39NUkYEvi8hIw6R/S1ucvqDMudx4n1oZUKNS+6d7+kNb3fznjdTqaiWIb/WO8 X-Received: by 2002:aa7:d2cd:0:b0:463:23a4:aa9e with SMTP id k13-20020aa7d2cd000000b0046323a4aa9emr57038380edr.362.1668067169374; Wed, 09 Nov 2022 23:59:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668067169; cv=none; d=google.com; s=arc-20160816; b=E52MmbIMh8sYxIdNvoEyPp0LGeE4j1rNX/igewRrl1ZPaNRHyWVqUhYqagjYYw8foM LicWVp26sS0ZDDA0DfHR21fhuv0Yt3+Wl3ZSo2GmGJNbgVKB2t5R+Q3R04neBJ7sYKR2 9ni2NyxX925MEuD9/25kEqPSmqrbwPMaY9mi0vyxUE8shlEQgcO+frR1aavdoo8cMEk1 j7FpZU7k+ZE4I5NCdBgsCj7rbfQ7xLqwAuiGgkf9RO2hTpB/+ui9tsZ+TyXpTqXzFoZ7 CWS/UY7weC6pRlYov3v1orUNAIqZCwNsUYwhgxftUC9AFb3mv62nmI4wZj6UEmPjIyKz eBmQ== 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 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.09.23.59.04; Wed, 09 Nov 2022 23:59:29 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749095200559465087?= X-GMAIL-MSGID: =?utf-8?q?1749095200559465087?= 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;