From patchwork Tue Feb 13 09:36:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pankaj Raghav (Samsung)" X-Patchwork-Id: 13554781 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 738F8C4829A for ; Tue, 13 Feb 2024 09:37:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E9B966B0072; Tue, 13 Feb 2024 04:37:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E4AF36B0074; Tue, 13 Feb 2024 04:37:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D23296B0075; Tue, 13 Feb 2024 04:37:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id BF6536B0072 for ; Tue, 13 Feb 2024 04:37:25 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7AE28140AFB for ; Tue, 13 Feb 2024 09:37:25 +0000 (UTC) X-FDA: 81786277650.13.43E9035 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by imf24.hostedemail.com (Postfix) with ESMTP id 8BD99180026 for ; Tue, 13 Feb 2024 09:37:23 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=OD4iggFM; dmarc=none; spf=pass (imf24.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.172 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707817044; a=rsa-sha256; cv=none; b=4nfLFWqkimT4u3mTd1nLCvMpsHXVhJn6lujhZbIdW8fm9hIM1f7mOL/cIUue/agWZlMeCd qDbk9moXFoxU9dj1rDjkCSXJMEO6ZrGnV2pieYvlFmSggq+j80iaBey9LtgKw0rzlT2EVu j+2CCnVQAW+ITkjNbRIAw89/YTvAVZ4= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=OD4iggFM; dmarc=none; spf=pass (imf24.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.172 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707817044; 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: references:dkim-signature; bh=/nATs3SuO4faY1mpCrALcbEB9qiePNdJP0j+dhEQhPM=; b=cH82k77CsfqIo0WDi5kyPYYpsFNynhOghP0ilf/oEjXyJBYUq9gD6IZl3NuXjXK6dDh3Ry JkcRVIgpi2hzFH9Vxh4XKIerQ9DKPRQZeeDQIoon4eIdqmE44xoLbB6DrN6YEC0Aau5I5C VMrXIbq/7CcYiSu3X9DlQXusnpVPuC8= Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4TYx7L0BFvz9t1x; Tue, 13 Feb 2024 10:37:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1707817038; h=from:from: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; bh=/nATs3SuO4faY1mpCrALcbEB9qiePNdJP0j+dhEQhPM=; b=OD4iggFME3PNcclujYe65LlZhySTHyF1jpEsqvMob21KT6LdGRlTn3FA9UB9IUmsfMae98 ehZzaV52pg7fsEAyJ5zo5G/aNvql1jFmwcGReNIGLrDFW2oFVus14KfdROXRRsv/Hci/Dt aMGU0qGt3tYxu5kOlhHTkMTh+K3kDcc4/HnrQREQkHRWH8aAOS0h3GsR61v5i2YaZI15qg yBim8jvZ9Sw+lVFHGEgYtwoxq1ze6RrwQUKYdRI1zbrWzgxjCIYsW+Q/FP8fWN7kmNSwbi 5fLeJOJQb4UTOHp9YOgwGv2Ur2rsUDD9U2djRybjan/ih/EXGhb94vEyC+DXVQ== From: "Pankaj Raghav (Samsung)" To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: mcgrof@kernel.org, gost.dev@samsung.com, akpm@linux-foundation.org, kbusch@kernel.org, djwong@kernel.org, chandan.babu@oracle.com, p.raghav@samsung.com, linux-kernel@vger.kernel.org, hare@suse.de, willy@infradead.org, linux-mm@kvack.org, david@fromorbit.com Subject: [RFC v2 00/14] enable bs > ps in XFS Date: Tue, 13 Feb 2024 10:36:59 +0100 Message-ID: <20240213093713.1753368-1-kernel@pankajraghav.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 8BD99180026 X-Stat-Signature: zm5iytg4w53re1s8qz7idur77er45hmb X-HE-Tag: 1707817043-586937 X-HE-Meta: U2FsdGVkX1+qIXf26Fz7Ax4tibL2rYlMc4jBv6Ze+1ozu/F+oCRmfi6TqBeepqyWiJHeih3QNZH//ny2LQVb1FJd7Cmp+8UgtXeycDsnGLe8ZkLgEQG4LcbLR775k1+BZlWfAuJ8jDt/xxPXVM4Zpjn1pCkKVdadVwmx9R7wjJtwCBI0sWSf0tGWwuqS696BY0zZtHJMWtLLTHTP96M27/7PMLAuu2Cue1qTw0LXhlsK2gtyfCH11wEfKHRVY/X3iS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wetvw6PLKagvuUuOzM+DcjPuj4C/9omirqSAayzp7RyGkQhtPBX+SZzcJIxfvw6BLbc0WJ80GI5LnSp0NxmGCAHqtKXN12kHdgat/29Qb7oOjdJxIf2oMi57UmuXQDhwCADwwJnDsQ1pMi8Oz+TIpStQ8RPI= 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: List-Subscribe: List-Unsubscribe: From: Pankaj Raghav This is the second version of the series that enables block size > page size (Large Block Size) in XFS. This version has various bug fixes and suggestion collected from the v1[1]. The context and motivation can be seen in cover letter of the v1. We also recorded a talk about this effort at LPC [2], if someone would like more context on this effort. A lot of emphasis has been put on testing using kdevops, and fixing some critical bugs for LBS. The testing has been split into regression and progression. Regression testing: In regression testing, CONFIG_XFS_LBS was disabled and we ran the whole test suite with SOAK_DURATION=2.5 hours to check for *regression on existing profiles due to the page cache changes. No regression was found with the patches added on top. * Baseline for regression was created using SOAK_DURATION of 2.5 hours and having used about 7-8 XFS test clustes to test loop fstests over 70 times. We then scraped for critical failures (crashes, XFS or page cache asserts, or hung tasks) and have reported these to the community as well.[3] Progression testing: For progression testing, CONFIG_XFS_LBS was enabled and we tested for 8k, 16k, 32k and 64k block sizes. To compare it with existing support, an ARM VM with 64k base page system(without our patches) was used as a reference to check for actual failures due to LBS support in a 4k base page size system. There are some common failures upstream for bs=64k that needs to be fixed[4]. There are also some tests that assumes block size < page size that needs to be fixed. I have a tree with fixes for xfstests here [5], which I will be sending soon to the list. The only real failure for LBS currently is: - generic/630 for 8k block size. This tests dedupe race and it only fails for 8k blocksize, and it does not fail on a 64k base page system. We've done some preliminary performance tests with fio on XFS on 4k block size against pmem and NVMe with buffered IO and Direct IO on vanilla v6.8-rc4 Vs v6.8-rc4 + these patches applied, and detected no regressions. We also wrote an eBPF tool called blkalgn [6] to see if IO sent to the device is aligned and at least filesystem block size in length. Git tree: https://github.com/linux-kdevops/linux/tree/large-block-minorder-6.8.0-rc4 Changes since RFC v1: - Added willy's patch to enable order-1 folios. - Unified common page cache effort from Hannes LBS work. - Added a new helper min_nrpages and added CONFIG_THP for enabling mapping_large_folio_support - Don't split a folio if it has minorder set. Remove the old code where we set extra pins if it has that requirement. - Split the code in XFS between the validation of mapping count. Put the icache code changes with enabling bs > ps. - Added CONFIG_XFS_LBS option - align the index in do_read_cache_folio() - Removed truncate changes - Fixed generic/091 with iomap changes to iomap_dio_zero function. - Took care of folio truncation scenario in page_cache_ra_unbounded() that happens after read_pages if a folio was found. - Sqaushed and moved commits around - Rebased on top of v6.8-rc4 [1] https://lore.kernel.org/lkml/20230915183848.1018717-1-kernel@pankajraghav.com/ [2] https://www.youtube.com/watch?v=ar72r5Xf7x4 [3] https://github.com/linux-kdevops/kdevops/blob/master/docs/xfs-bugs.md 489 non-critical issues and 55 critical issues. We've determined and reported that the 55 critical issues have all fall into 5 common XFS asserts or hung tasks and 2 memory management asserts. [4] https://lore.kernel.org/linux-xfs/fe7fec1c-3b08-430f-9c95-ea76b237acf4@samsung.com/ [5] https://github.com/Panky-codes/xfstests/tree/lbs-fixes [6] https://github.com/iovisor/bcc/pull/4813 Dave Chinner (1): xfs: expose block size in stat Hannes Reinecke (1): readahead: rework loop in page_cache_ra_unbounded() Luis Chamberlain (3): filemap: align the index to mapping_min_order in the page cache readahead: set file_ra_state->ra_pages to be at least mapping_min_order readahead: align index to mapping_min_order in ondemand_ra and force_ra Matthew Wilcox (Oracle) (2): fs: Allow fine-grained control of folio sizes mm: Support order-1 folios in the page cache Pankaj Raghav (7): filemap: use mapping_min_order while allocating folios readahead: allocate folios with mapping_min_order in ra_(unbounded|order) mm: do not split a folio if it has minimum folio order requirement iomap: fix iomap_dio_zero() for fs bs > system page size xfs: make the calculation generic in xfs_sb_validate_fsb_count() xfs: add an experimental CONFIG_XFS_LBS option xfs: enable block size larger than page size support fs/iomap/direct-io.c | 13 +++++- fs/xfs/Kconfig | 11 +++++ fs/xfs/xfs_icache.c | 8 +++- fs/xfs/xfs_iops.c | 4 +- fs/xfs/xfs_mount.c | 10 ++++- fs/xfs/xfs_super.c | 8 ++-- include/linux/huge_mm.h | 7 ++- include/linux/pagemap.h | 92 ++++++++++++++++++++++++++++++-------- mm/filemap.c | 61 ++++++++++++++++++++------ mm/huge_memory.c | 36 ++++++++++++--- mm/internal.h | 4 +- mm/readahead.c | 97 ++++++++++++++++++++++++++++++++--------- 12 files changed, 276 insertions(+), 75 deletions(-) base-commit: 841c35169323cd833294798e58b9bf63fa4fa1de