From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48A44CE79AA for ; Tue, 19 Sep 2023 16:28:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD3BD6B0093; Tue, 19 Sep 2023 12:28:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C86496B0095; Tue, 19 Sep 2023 12:28:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B245F6B0096; Tue, 19 Sep 2023 12:28:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id A469F6B0093 for ; Tue, 19 Sep 2023 12:28:15 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 679318052F for ; Tue, 19 Sep 2023 16:28:15 +0000 (UTC) X-FDA: 81253879350.29.CF7F3F5 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by imf02.hostedemail.com (Postfix) with ESMTP id 07CC980009 for ; Tue, 19 Sep 2023 16:28:11 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=Mz4pQBv8; spf=pass (imf02.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=da.gomez@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695140892; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=X9Vh3xSdS13+TvaqDkbe6m4bnluDyBDtHOnoCxrZwGo=; b=nhYD3TmFyF0IlUedyxJbe+TAJxcX4bVZoH6RvTycK8UdNd4b/2C1wMS4XrHbnG8MNE2CKN uVO+b/Apsiqsa9n203vAaM6pyYb8E4Ms6h59D0/gIScDaMAzx4ICQqWqI/WBVOYqCJO99/ ZozB1JdC6CzOP4HoD6KPHDup0eKVD/4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695140892; a=rsa-sha256; cv=none; b=xs+cASiwj7ZSKBzkl87UgzIhYVhzJIXSjtpuRFhL6axavDpSJd74UwK0uzpBhl3pLvfm5w UZODWwBhPf0NVv0G6Hc1bc5ZRKWkFu9JbkkWNjKVo6nKPm98dohSX6+0+akfeAaLjKopP+ Nk7RajodWl3B+e7vR5ObIo1+xaE0jKc= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=Mz4pQBv8; spf=pass (imf02.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=da.gomez@samsung.com; dmarc=pass (policy=none) header.from=samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230919162809euoutp027cd9228a16c8d66c039872cf895007d9~GWahecYr-2291322913euoutp02o for ; Tue, 19 Sep 2023 16:28:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230919162809euoutp027cd9228a16c8d66c039872cf895007d9~GWahecYr-2291322913euoutp02o 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+fGbsYuT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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-Rspamd-Queue-Id: 07CC980009 X-Rspam-User: X-Stat-Signature: 5nzpz963k9b67aqoxcd7fgphejrbobih X-Rspamd-Server: rspam03 X-HE-Tag: 1695140891-244442 X-HE-Meta: U2FsdGVkX19J3ln+i5uIdfPFglFSYvfQaODCaqOVfD9k0IfeH94XxOatGcFZnVwFkAXtnAyprawTygs8BAbyslFwlFrn0q/0JnqMcKvKkeAYW9gYJE2jkBhErbKGJKoUyLd4OhbGzcMwdtP2TPz465kOymaiMEThWRmGwVXz6f48M2cqujwyeR1xj1GJJ5K2hr+zl1PRWkLdFJXpcIFTJet4BikpaPK6avdADlqY7RY6tYTsbMFlAFH7c7ZEDsbk6/38ukQdh8XBM0BbVY91GUqjD+EMZH0KFf3RsfeA/XP816DC0rkSR2luUwNgfv80cW6j92mt3ubmAu6EfmLSd0VZ2XFY/E0f0M4ww/BddpxNqCRDNygCWS5xRqQbU41WUjlHIK2Jr2uyNp0LfmfLIus8sSxAWCeuE/5wLhO7hS+m3PRtVXjplrL2LIOtHQGmphN5HRodnTv5BMIhDg9e9BQMDskxHny6KY943zqXqw0V4WsCT5AoUMtTxkhBSo3Hc7Ivkp9UYYjrP/vlKiflgacI2wZGU7DuVD/yb+xrx66xrbXHXt1bOCsbChgn+S4mGAHM/r5rKNz3NQR9fIk5HUyJvcy9T98NzI1G3U9ktWKOSoOmpa6UftpiTqP8m0HAp9xJHsi277TYazxsOnnCmj5sxtaiSIYoSnoQTFLa9cEWQdF616MzMNd0h0SszMKiYzkbNaIRtCSOWARVkc1AZLnjrARs2UWpsQIRbx29ElrB/fljoC7+W7BGjZc46NcawVlch0JO0G8og6IhBYzqc1LgxK07BWSIycSI+nKbqv7n3siSNI6Xndv2PR2SDXV+l1Almfz8Dr62kTlB+3hwG1mf2GsWUCo0858xZg2eh/Y1BtTx/KWsehJUUuMON6OJR7pct4SICHwW9LJ4V8mYVPrS+Bcvqp3tOPcUx3aNDAWz5fT0n3r45hCMEORMMFc1xdx1qRC09Bc6zvz5rGQ P4j3gBKV wCKp7f9JCjW0usTgpJ3M/YhqloUyinRslac+ZVzLksIXjWSWo6ZRKuYhuLoGaNx+AW0EjdLvsVLULTTo4sOtgEyelfkKyE9I38BRE8YSjzDmIGm/W0S/JPYB2ZeNAs5JIzqMW8PhHw8FVxacMeB/qS9zaW2dxqFXyIih5 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.=