Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp948606rdb; Tue, 19 Sep 2023 15:36:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdyrUOW+aTvAjipqIZxxzI83kSe49ewu324+XheWWd1X1YcjkzasFb8lGg+2uyT0xSgbz2 X-Received: by 2002:a17:90a:4594:b0:276:78f2:5d31 with SMTP id v20-20020a17090a459400b0027678f25d31mr1101979pjg.21.1695163014556; Tue, 19 Sep 2023 15:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695163014; cv=none; d=google.com; s=arc-20160816; b=Bmpnor79t9T1t6p0+wd3xN+A3GDor5JNV7y9f9apgHtr/FhhaqcgNZne16wOEaPg1U wRMh9jO2Tm3lSbiuowrDxWaTsBfwN2d7POT3H6efIPZ4z7bLLhTzKSe9PYilae+oC20b lzcYHOn7AajOgOo9OvCnsqbIDpQDLqAi3iW/NfIY3a5onSYZOB76pOk/nqMKCQjGqoln 3/kVXo5ynHBg2rmO/GNcoJcYrp30iPEp9pfA+pPqBOmi3MbO4ZmeMQMlC9UA7k/LVHxY t7XS1fUzU1npr1FBRk3QBaewhmI9AvltOkbyGMFyCdYUFQK7M85IzWNG8TLHNGb41zQ6 QyGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:mime-version :content-transfer-encoding:content-id:content-language :accept-language:in-reply-to:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:dkim-filter; bh=X9Vh3xSdS13+TvaqDkbe6m4bnluDyBDtHOnoCxrZwGo=; fh=wq2dFTgqBetHCM369K3nSWx9+Ek5C8S2/IOktMpM8t0=; b=Xba7vsnn/9O6Cc5FsL6YFuHZQCgUyyj80asqdmWmeRsPcalfu0SPPQ+A3PqtcwGSRJ ZR66JuMPR35lsE6Fo+MJMOJxLHdgSooGjqet4vHg+r5YbNTSsqgLdWJmG9pnlCeH+ZJV gnptGWmDTRwj7YgI4pESBld2+Irq8gr544fgkCLkkLTD4Q1tN9hlEGaub60WHvqoTBgY f6JaTHuYRHj72Y9dgWCJqKgtzsyDKwE2NrKIUqZH9QWYYY2ydgi31xs8k3hfgH77thHE TlIbu95AegNQ777ZqYY+RENYNf/WOWpIl63zhVO+avS+encReQ4JTkGKJu4ntOO54obj 2qLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Mz4pQBv8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id n11-20020a17090ade8b00b00263f3c1bb86si162135pjv.158.2023.09.19.15.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 15:36:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Mz4pQBv8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 92697805D5DF; Tue, 19 Sep 2023 09:28:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjISQ2W (ORCPT + 99 others); Tue, 19 Sep 2023 12:28:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjISQ2V (ORCPT ); Tue, 19 Sep 2023 12:28:21 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CE02AC for ; Tue, 19 Sep 2023 09:28:13 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230919162809euoutp015c3be3488a19ee46a5328c0617e031db~GWahebHRc0367803678euoutp01f for ; Tue, 19 Sep 2023 16:28:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230919162809euoutp015c3be3488a19ee46a5328c0617e031db~GWahebHRc0367803678euoutp01f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1695140889; bh=X9Vh3xSdS13+TvaqDkbe6m4bnluDyBDtHOnoCxrZwGo=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=Mz4pQBv8pTu2ekGs/PNcrj6YTtsiJgRZGHxJUR6NJ4cXM3rPtyuEyutQx9scsVBzk MHqyIkeyCLdRbNRSFqIS7UJcWJtfr5FcC7G6v4eXq7gj5xyw8b+Ugexd2yF6o1AdEh vUQMOd4RXraUs1tZNHNMu1OwJaU2zb50PSqyvMJY= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230919162809eucas1p19a3e25971dc7ec568f69d95ab66e5116~GWahODslI0969909699eucas1p1A; Tue, 19 Sep 2023 16:28:09 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 85.2B.11320.91CC9056; Tue, 19 Sep 2023 17:28:09 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230919162808eucas1p2d773186479b84364e8adf1a286a92af0~GWag42J7U1672016720eucas1p2t; Tue, 19 Sep 2023 16:28:08 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230919162808eusmtrp2c556456594d71a1a2b7bef03884aee32~GWag4PRUk1247812478eusmtrp2s; Tue, 19 Sep 2023 16:28:08 +0000 (GMT) X-AuditID: cbfec7f4-97dff70000022c38-4d-6509cc19bd3d Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 79.7A.14344.81CC9056; Tue, 19 Sep 2023 17:28:08 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230919162808eusmtip1b2416a662eb13677c901f2a87854b0ca~GWagpvZDz0507805078eusmtip17; Tue, 19 Sep 2023 16:28:08 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 Sep 2023 17:28:07 +0100 Received: from CAMSVWEXC02.scsc.local ([::1]) by CAMSVWEXC02.scsc.local ([fe80::3c08:6c51:fa0a:6384%13]) with mapi id 15.00.1497.012; Tue, 19 Sep 2023 17:28:07 +0100 From: Daniel Gomez To: Matthew Wilcox CC: "minchan@kernel.org" , "senozhatsky@chromium.org" , "axboe@kernel.dk" , "djwong@kernel.org" , "hughd@google.com" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "gost.dev@samsung.com" , Pankaj Raghav Subject: Re: [PATCH v2 6/6] shmem: add large folios support to the write path Thread-Topic: [PATCH v2 6/6] shmem: add large folios support to the write path Thread-Index: AQHZ6wEBFE+DTgi9xUu5khR159FX3LAiLYSAgAAYPoA= Date: Tue, 19 Sep 2023 16:28:07 +0000 Message-ID: <20230919162805.m6hbrmwq4gm4iiv5@sarkhan> In-Reply-To: Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [106.110.32.103] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEKsWRmVeSWpSXmKPExsWy7djP87qSZzhTDeY+ZLGYs34Nm8Xqu/1s Fpef8Fk8/dTHYrH3lrbFnr0nWSwu75rDZnFvzX9Wi11/drBb3JjwlNFi2df37Ba7Ny5is/j9 Yw6bA6/H7IaLLB4LNpV6bF6h5XH5bKnHplWdbB6bPk1i9zgx4zeLx+dNcgEcUVw2Kak5mWWp Rfp2CVwZE07/Zi14KV7x+uRC5gbG4/xdjJwcEgImEnc+fGbsYuTiEBJYwSjx/fw/NgjnC6PE hIs32CGcz4wSG54tZINpWdm6ACqxnFFi4ukXbHBVO1edZwWpEhI4wyhxvF8SIrGSUeLv1GPs IAk2AU2JfSc3AdkcHCICGhJvthiB1DALHGWVWLJ2EwtIjbCAv8Tyg2/B6kUEAiTa+q8wQdhW Ei0n5zKD2CwCqhJ9s24wg8zhFTCVWNZZAmJyAl238asTSAWjgKzEo5W/wKYwC4hL3Hoynwni AUGJRbP3MEPYYhL/dj2EekxH4uz1J4wQtoHE1qX7WCBsJYk/HQsZIeboSCzY/YkNwraUWLFs BpStLbFs4WuwmbxA80/OfALVO5NL4tIvO5DTJARcJJq+ZECEhSVeHd/CPoFRZxaS62Yh2TAL yYZZSDbMQrJhASPrKkbx1NLi3PTUYqO81HK94sTc4tK8dL3k/NxNjMBkd/rf8S87G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hBHC NpDYunQfC4StJPGnYyEjxBwdiQW7P7FB2JYSK5bNgLK1JZYtfA02k1dAUOLkzCcsExhlZiFZ PQtJ+ywk7bOQtM9C0r6AkXUVo0hqaXFuem6xkV5xYm5xaV66XnJ+7iZGYCrbduznlh2MK199 1DvEyMTBeIhRgoNZSYR3piFbqhBvSmJlVWpRfnxRaU5q8SFGU2DITWSWEk3OBybTvJJ4QzMD U0MTM0sDU0szYyVxXs+CjkQhgfTEktTs1NSC1CKYPiYOTqkGpv49/REhfTdlxG99YdA6pvj6 1+quDLfN4jMm3dZY8Gl10oKzO/Rr+h9dyfk0fesCa2dv0703etc+OvPYoO74TbbCCqmtOQWm EVzLphbyP5tV+zsp6/eGrWwn5znPn7Jy4q/JvT5/yzUZWrn/TjQROPaScZI5oxGbxvt+1jlv 194QfXssJzRj38uTi+Zn7myLc3k+Y4b0xuLFBUrxHcX18oV/BUPy63n1rhyNi/+qfqxfNeKY HfesGaph04xUpixXtvnfvv+m4KR133ac2rZn2fHPwkHc3f3eeX3lYiIVt/wW7hb97WPDwHHl 2Le3PwsLb03O6P5j9Dnu2rRZJfbPFi1rKVllYcv8gUl8YelW/ltKLMUZiYZazEXFiQCeQcBG 7gMAAA== X-CMS-MailID: 20230919162808eucas1p2d773186479b84364e8adf1a286a92af0 X-Msg-Generator: CA X-RootMTR: 20230919135556eucas1p19920c52d4af0809499eac6bbf4466117 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230919135556eucas1p19920c52d4af0809499eac6bbf4466117 References: <20230919135536.2165715-1-da.gomez@samsung.com> <20230919135536.2165715-7-da.gomez@samsung.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 09:28:35 -0700 (PDT) On Tue, Sep 19, 2023 at 04:01:19PM +0100, Matthew Wilcox wrote: > On Tue, Sep 19, 2023 at 01:55:54PM +0000, Daniel Gomez wrote: > > Add large folio support for shmem write path matching the same high > > order preference mechanism used for iomap buffered IO path as used in > > __filemap_get_folio() with a difference on the max order permitted > > (being PMD_ORDER-1) to respect the huge mount option when large folio > > is supported. > > I'm strongly opposed to "respecting the huge mount option". We're > determining the best order to use for the folios. Artificially limiting > the size because the sysadmin read an article from 2005 that said to > use this option is STUPID. Then, I would still have the conflict on what to do when the order is same as huge. I guess huge does not make sense in this new scenario? unless we add large folios controls as proposal in linux-MM meeting notes [1]. But I'm missing a bit of context so it's not clear to me what to do next. [1] https://lore.kernel.org/all/4966f496-9f71-460c-b2ab-8661384ce626@arm.co= m/T/#u In that sense, I wanted to have a big picture of what was this new strategy implying in terms of folio order when adding to page cache, so I added tracing for it (same as in readahead). With bpftrace I can see the following (notes added to explain each field) after running fsx up to 119M: @c: 363049108 /* total folio order being traced */ @order[8]: 2 /* order 8 being used 2 times (add_to_page_cache) */ @order[5]: 3249587 */ order 5 being used 3249587 times (add_to_page_cache) */ @order[4]: 5972205 @order[3]: 8890418 @order[2]: 10380055 @order[0]: 334556841 @order_2: /* linear histogram of folio order */ [0, 1) 334556841 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= @@@@| [1, 2) 0 | = | [2, 3) 10380055 |@ = | [3, 4) 8890418 |@ = | [4, 5) 5972205 | = | [5, 6) 3249587 | = | [6, 7) 0 | = | [7, 8) 0 | = | [8, 9) 2 | = | I guess that's not te best workload to see this but would tracing be also interesting to add to the series? > > > else > > - folio =3D shmem_alloc_folio(gfp, info, index, *order); > > + folio =3D shmem_alloc_folio(gfp, info, index, order); > > Why did you introduce it as *order, only to change it back to order > in this patch? It feels like you just fixed up patch 6 rather than > percolating the changes all the way back to where they should have > been done. This makes the reviewer's life hard. > Sorry about that. I missed it in my changes.=