Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp1280994imk; Sun, 3 Jul 2022 22:59:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tA1kL8ZL39m8zcE/f50O+n6SL9ePq8Kq8iGjnxSOr4/Yi8Y10vMNFpXrMdokY/gPDbSJ0r X-Received: by 2002:a17:907:2bd6:b0:72a:3f51:8093 with SMTP id gv22-20020a1709072bd600b0072a3f518093mr25176105ejc.134.1656914377083; Sun, 03 Jul 2022 22:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656914377; cv=none; d=google.com; s=arc-20160816; b=dDQczxjqox2EfPB0/sueS1z5izL8sRouNS4fYne4TDBKLFrXbA0M0/WYRN5uFjiYcV R5/awlMMv0/pwvdsiVDVOcEEFUvD2eUGVtn4IuN/xag/NZCN28OJYvpFzEuKRLwxjcQg kkIOAnipTcCiWw2lAWuk2m/kUfndTHH9h3/eIdOowFoAB3+JxzzGsaY5BPFZ8DjDzu7R kzmdsVWiKYxyB+P2me5gNI9Iqe934giEvU32YjjNoHhZVpX6Vp/bj54Nyuhxgm1sVp7y fxgYUErc5bVKhIs6a8rI15hpBhqUutA+ruG4/3OUA4V8mTde89KQMjhFPtqM7QehwkZy U06w== 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:dkim-signature; bh=PwndybbU5St62Xaa17A+kFodMrjT7D2lRUFJja/O3A4=; b=TGY+xAMXiCOyo65j52ZCkyX3jgtQNM/IubTw4fE7WSMEPILXMvzROfXvL7JoLlChiz MB7atBsg3I0bQLIPvIaY97w17B+Ys9wWRhG+b+aDBpZY8IyDwRX8pi1ecNgLOt8zBPvP KZyqvk61d2aSFPPGBvDqb/UNEQMWuqq6yKVUg2c6YcAQ4w4Dc1uczQqOq5MDbseyjYYO n3jiskCxzwXezjiaUB9FYhbfi+odKVReFo7WfpHvYRt9vytaPR6hIoLPXjQE0A0Ps0qA THBig984FzqgHStJQ00eqyTCz+1foqlaQkcspDZ+ZpDU5EbvMTiMR3EF3VJ4tg5zBGsw JO9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=NFnjF+rq; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s26-20020a50d49a000000b00435656b4fcasi34890184edi.383.2022.07.03.22.59.02; Sun, 03 Jul 2022 22:59:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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; dkim=pass header.i=@ibm.com header.s=pp1 header.b=NFnjF+rq; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232625AbiGDFqR (ORCPT + 99 others); Mon, 4 Jul 2022 01:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231833AbiGDFqQ (ORCPT ); Mon, 4 Jul 2022 01:46:16 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51687658F; Sun, 3 Jul 2022 22:46:14 -0700 (PDT) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2643LbrL003589; Mon, 4 Jul 2022 05:46:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=PwndybbU5St62Xaa17A+kFodMrjT7D2lRUFJja/O3A4=; b=NFnjF+rqrwl0Cvo/xVNxiRg5Z9eXjq6/fIbFdOxcrtyFC9dma8B84g2LzTQ7tIzi+9yS wLsZ8MWZidAwjGLbKKjPSweY9YEQ93Zoojo4+K81AdMeqIMt/Ipj2mGfVF4ET2wwVho9 zH+CMqdBN01Krl4g+94np1vy/8mdwb0Qp8xB2dR5GVmGIKdKDkvtZ6f1IKVbv3xkHgc/ WzbTpATRZmqHRcYvBprfXzsZIi7BwdNvLAFAs1iri1eSW2oPm2k+AB4rQmxGj651MC9T 6mRN5Uy0+WrlYwwRH1PJkPV3ZFhbUN6P/t0KnvFuMBzRNrq1F9yeyte73Ga2rk6SfISs lA== Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3h3r7yja69-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Jul 2022 05:46:12 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2645aH2l005963; Mon, 4 Jul 2022 05:46:10 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03fra.de.ibm.com with ESMTP id 3h2dn8sn2s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Jul 2022 05:46:10 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2645k8jH19005922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Jul 2022 05:46:08 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 46A4442042; Mon, 4 Jul 2022 05:46:08 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6804E4203F; Mon, 4 Jul 2022 05:46:06 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com (unknown [9.43.91.160]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 4 Jul 2022 05:46:06 +0000 (GMT) From: Ojaswin Mujoo To: linux-ext4@vger.kernel.org Cc: "Theodore Ts'o" , Ritesh Harjani , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ext4: Reflect mb_optimize_scan value in options file Date: Mon, 4 Jul 2022 11:16:03 +0530 Message-Id: <20220704054603.21462-1-ojaswin@linux.ibm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: l3BjGiAVlvRLgJqbWgWrlkSH0gmQC_IM X-Proofpoint-ORIG-GUID: l3BjGiAVlvRLgJqbWgWrlkSH0gmQC_IM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-04_05,2022-06-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 clxscore=1011 spamscore=0 mlxscore=0 malwarescore=0 impostorscore=0 suspectscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2207040023 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-ext4@vger.kernel.org Add support to display the mb_optimize_scan value in /proc/fs/ext4//options file. The option is only displayed when the value is non default. Signed-off-by: Ojaswin Mujoo --- fs/ext4/super.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 845f2f8aee5f..e3fd50b0d6b7 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3011,6 +3011,15 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb, } else if (test_opt2(sb, DAX_INODE)) { SEQ_OPTS_PUTS("dax=inode"); } + + if (sbi->s_groups_count >= MB_DEFAULT_LINEAR_SCAN_THRESHOLD && + !test_opt2(sb, MB_OPTIMIZE_SCAN)) { + SEQ_OPTS_PUTS("mb_optimize_scan=0"); + } else if (sbi->s_groups_count < MB_DEFAULT_LINEAR_SCAN_THRESHOLD && + test_opt2(sb, MB_OPTIMIZE_SCAN)) { + SEQ_OPTS_PUTS("mb_optimize_scan=1"); + } + ext4_show_quota_options(seq, sb); return 0; } -- 2.27.0