From patchwork Fri Jul 26 11:59:46 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: 13742699 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 F31A0C3DA49 for ; Fri, 26 Jul 2024 12:00:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7185D6B0082; Fri, 26 Jul 2024 08:00:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C6096B00A4; Fri, 26 Jul 2024 08:00:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58DB06B00A5; Fri, 26 Jul 2024 08:00:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3AD016B0082 for ; Fri, 26 Jul 2024 08:00:14 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 725FC1A17E8 for ; Fri, 26 Jul 2024 12:00:13 +0000 (UTC) X-FDA: 82381760706.11.1D9ADA1 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by imf15.hostedemail.com (Postfix) with ESMTP id 74EDDA0038 for ; Fri, 26 Jul 2024 12:00:10 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=tgnSLdEa; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf15.hostedemail.com: domain of kernel@pankajraghav.com designates 80.241.56.172 as permitted sender) smtp.mailfrom=kernel@pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721995209; a=rsa-sha256; cv=none; b=RZZZFTAK9zM8TBK7wa+mAApSrHjEiVyoSWrT6y4orze8QoS7eTj8v2XRC3Zyehmpkd4ozo zh3PCf3rMGRY75cHXhBxVKN7kIkutv/cffMKN2qzrSxdl9utF/CKavX/Ru1OAQxn74R+BL +UF+0AS9b68Y12Y0eQBDP6ar94c0e+0= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=tgnSLdEa; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf15.hostedemail.com: domain of kernel@pankajraghav.com designates 80.241.56.172 as permitted sender) smtp.mailfrom=kernel@pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721995209; 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=9qZr/ATSZTta7NMIGHNvqBoEiw6Q/kr2hVtOqD/V8So=; b=le8lyUnyuCfmwHHy/DuPLYQkjLUHYe5j4mJaRPxkHzBOrGD7hhODcHxtNKa2wKNM/FfspM AY2IMfynWydRw47aLHtcC6aYv7C8E/0GtGKLVdinTxrrYl1jKdQrOA7HadPAi7zcyypi/+ 5z5Q4txLofyNyE6N1mU4ltI3YTEaWCU= Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (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 4WVmXP313Tz9t6L; Fri, 26 Jul 2024 14:00:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1721995205; 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=9qZr/ATSZTta7NMIGHNvqBoEiw6Q/kr2hVtOqD/V8So=; b=tgnSLdEaPvLYG38D4sbvgwj4Sc0DUMOYO+I/SiPFS6rG16hrBXGUAMzY1SIkpzSweYCfsF FLiohDQC/sOZKtEu3f5jBfeyfConpQHYBf2M0tPDKBqLfuAPhddCBmHweMDMKbnC77waej prALgH5tsKWcO7F4gIIhexgdPuc6aAa8HQGoftAHuFrsy6aVkspE+S7PRtG7i8NeigVIiq TaNx2hzBhObP3wKo3req8fWzhj2HNLEkcSgiJCJhudOFHU2NAsNJyb23r/p23TpuMe1NSZ RXLRsdC8JgE7uGm1YGD5wsLc0SEmrBPK+l0sAGpvnjAPoRdvtp09IBGKg6MfZw== From: "Pankaj Raghav (Samsung)" To: david@fromorbit.com, willy@infradead.org, chandan.babu@oracle.com, djwong@kernel.org, brauner@kernel.org, akpm@linux-foundation.org Cc: yang@os.amperecomputing.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, john.g.garry@oracle.com, linux-fsdevel@vger.kernel.org, hare@suse.de, p.raghav@samsung.com, mcgrof@kernel.org, gost.dev@samsung.com, cl@os.amperecomputing.com, linux-xfs@vger.kernel.org, kernel@pankajraghav.com, ryan.roberts@arm.com, hch@lst.de, Zi Yan Subject: [PATCH v11 00/10] enable bs > ps in XFS Date: Fri, 26 Jul 2024 13:59:46 +0200 Message-ID: <20240726115956.643538-1-kernel@pankajraghav.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 74EDDA0038 X-Rspamd-Server: rspam01 X-Stat-Signature: gx5hd77asbqfxd7ttr8eg4t8k8omzgxw X-HE-Tag: 1721995210-632987 X-HE-Meta: U2FsdGVkX19qJPQ6hN2CgMbLakWDluJ1+IL4mubWQpmivFfFQ0cfpJyCuJXpmIWF9Gv/jtmso08qod67LSzKWifbB+yM8X5nbKaUGvWq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8pRGLB1IY6vufTvVQlEn2Ctf1xRR3aLMbDUCJvxY5ikNurSCyAeUyXEps7oQU7znyna0HDyJqJvgoWQDWbrXP6gkIH4owikLQaDqfYnPyQ4csubZIeo3UjZ9swqTlBXQ189aofelJMAtqBTlLY1XcOkZ1Chm8VZx5jBT/CNJIZvAXTWcrgJLzkq9WD0y7boNiVubR8/boZOt0BVfwCBQOuEZ8ySzCu1PmtZzgaBchUSXTeSAbaFikMmXBzXjnycfP/yOQY6zqL1QlhruE1qJcccAw/MH81hU6DM+z9jkQek6tO+w+HK+ohEb 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 11th version of the series that enables block size > page size (Large Block Size) in XFS. The context and motivation can be seen in cover letter of the RFC v1 [0]. We also recorded a talk about this effort at LPC [1], if someone would like more context on this effort. A lot of emphasis has been put on testing using kdevops, starting with an XFS baseline [3]. The testing has been split into regression and progression. Regression testing: In regression testing, we ran the whole test suite to check for regressions on existing profiles due to the page cache changes. I also ran split_huge_page_test selftest on XFS filesystem to check for huge page splits in min order chunks is done correctly. No regressions were found with these patches added on top. Progression testing: For progression testing, 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 tests that assumes block size < page size that needs to be fixed. We have a tree with fixes for xfstests [4], most of the changes have been posted already, and only a few minor changes need to be posted. Already part of these changes has been upstreamed to fstests, and new tests have also been written and are out for review, namely for mmap zeroing-around corner cases, compaction and fsstress races on mm, and stress testing folio truncation on file mapped folios. No new failures were found with the LBS support. 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 Vs + these patches applied, and detected no regressions. We also wrote an eBPF tool called blkalgn [5] to see if IO sent to the device is aligned and at least filesystem block size in length. For those who want this in a git tree we have this up on a kdevops large-block-minorder-for-next-v11 tag [6]. [0] https://lore.kernel.org/lkml/20230915183848.1018717-1-kernel@pankajraghav.com/ [1] https://www.youtube.com/watch?v=ar72r5Xf7x4 [2] https://lkml.kernel.org/r/20240501153120.4094530-1-willy@infradead.org [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://github.com/linux-kdevops/fstests/tree/lbs-fixes [5] https://github.com/iovisor/bcc/pull/4813 [6] https://github.com/linux-kdevops/linux/ [7] https://lore.kernel.org/linux-kernel/Zl20pc-YlIWCSy6Z@casper.infradead.org/#t Changes since v10: - Revert back to silent clamping in mapping_set_folio_range(). - Moved mapping_max_folio_size_supported() to patch 10. - Collected RVB from Darrick. Dave Chinner (1): xfs: use kvmalloc for xattr buffers Luis Chamberlain (1): mm: split a folio in minimum folio order chunks Matthew Wilcox (Oracle) (1): fs: Allow fine-grained control of folio sizes Pankaj Raghav (7): filemap: allocate mapping_min_order folios in the page cache readahead: allocate folios with mapping_min_order in readahead filemap: cap PTE range to be created to allowed zero fill in folio_map_range() iomap: fix iomap_dio_zero() for fs bs > system page size xfs: expose block size in stat xfs: make the calculation generic in xfs_sb_validate_fsb_count() xfs: enable block size larger than page size support fs/iomap/buffered-io.c | 4 +- fs/iomap/direct-io.c | 45 +++++++++++-- fs/xfs/libxfs/xfs_attr_leaf.c | 15 ++--- fs/xfs/libxfs/xfs_ialloc.c | 5 ++ fs/xfs/libxfs/xfs_shared.h | 3 + fs/xfs/xfs_icache.c | 6 +- fs/xfs/xfs_iops.c | 2 +- fs/xfs/xfs_mount.c | 8 ++- fs/xfs/xfs_super.c | 28 +++++--- include/linux/huge_mm.h | 14 ++-- include/linux/pagemap.h | 122 ++++++++++++++++++++++++++++++---- mm/filemap.c | 36 ++++++---- mm/huge_memory.c | 59 ++++++++++++++-- mm/readahead.c | 83 +++++++++++++++++------ 14 files changed, 345 insertions(+), 85 deletions(-) base-commit: 2347b4c79f5e6cd3f4996e80c2d3c15f53006bf5