Message ID | 20240301164444.3799288-1-kernel@pankajraghav.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 1D98CC5475B for <linux-mm@archiver.kernel.org>; Fri, 1 Mar 2024 16:44:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB0DA6B007E; Fri, 1 Mar 2024 11:44:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A3A8D6B0080; Fri, 1 Mar 2024 11:44:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B4526B0081; Fri, 1 Mar 2024 11:44:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 76B9A6B007E for <linux-mm@kvack.org>; Fri, 1 Mar 2024 11:44:55 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 44F0E16021C for <linux-mm@kvack.org>; Fri, 1 Mar 2024 16:44:55 +0000 (UTC) X-FDA: 81849044550.15.E3EB14C Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by imf23.hostedemail.com (Postfix) with ESMTP id 220ED14000C for <linux-mm@kvack.org>; Fri, 1 Mar 2024 16:44:52 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b="jPMc/ol7"; spf=pass (imf23.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com; dmarc=pass (policy=quarantine) header.from=pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709311493; a=rsa-sha256; cv=none; b=dGszOAXCm70+Ob8Ffaf6Nd3SIllWP/3ldHZeu3xdtjx9b3zhvn9Mj30bFZH8PAbCTRz8IM s9aLAgyMaTy5iDJGbWjImHlrYEh7YXlzDXU2Pc/LrcxwFrot6stErIctRSicx69QpKNXkI 3oWbVwjuoUsHO0U2arN2o3AY/HGJVf8= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b="jPMc/ol7"; spf=pass (imf23.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com; dmarc=pass (policy=quarantine) header.from=pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709311493; 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=B6EQXGDOWVsQXY4t0Bt8vNPCHY1ASpHJpollkgEWkfs=; b=Yzls6+o9g+U2pGdH6fwGPbgSp4f9DkrMXmmFtAmiPZSWP2dyPIApnxvnUr5Ad4SaJ/WQB5 MIQ6aw6tfSORWh+x7tfoNFDdEOohpCtKKS9U6RpyFhXF8nDHRH6GsOhqyH5PmSJZl7zxsg 55zDhImqovKAkY/NfS38PzAoqy/GVtg= Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (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-201.mailbox.org (Postfix) with ESMTPS id 4TmYpm2ysvz9sRJ; Fri, 1 Mar 2024 17:44:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1709311488; 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=B6EQXGDOWVsQXY4t0Bt8vNPCHY1ASpHJpollkgEWkfs=; b=jPMc/ol77C0qbk1527YOqfnvneZwEIe61sS6kJCrptpvhJ2gb1Ie9RSoxoMxN1qmw6+uZP gUzWLNadsibNnLTJ0g2rtwfapinGO+q9mEMmYiq4K/838c2UWIMwUnvvPbzludSCA6mBk8 1WvjyjzvC7G64uwYTdl+U9ZcBQ1MLV80IT+9PBDruI3Txh+5kcR1u+IGQVJCGh+lapvLmO wVJdY1DbQvmVnqIqTsCZu1GjcUmsd0T5sOWzXh3Dmij1mpYMed5W+0rNnD4jiU/wu36hHg jfvia+y0t97RMkFgfP/aYDU7ZuH7pP/QuxTkwPeBnLfzKsN0Zy6hz6xarZfk3w== From: "Pankaj Raghav (Samsung)" <kernel@pankajraghav.com> To: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org Cc: djwong@kernel.org, mcgrof@kernel.org, linux-mm@kvack.org, hare@suse.de, david@fromorbit.com, akpm@linux-foundation.org, gost.dev@samsung.com, linux-kernel@vger.kernel.org, chandan.babu@oracle.com, willy@infradead.org, Pankaj Raghav <p.raghav@samsung.com> Subject: [PATCH v2 00/13] enable bs > ps in XFS Date: Fri, 1 Mar 2024 17:44:31 +0100 Message-ID: <20240301164444.3799288-1-kernel@pankajraghav.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 220ED14000C X-Stat-Signature: j9ap7cezn93qrqn6qiztww159kbhswqy X-Rspam-User: X-HE-Tag: 1709311492-254504 X-HE-Meta: U2FsdGVkX1/+eK4xNFbl0yWfukzOGcy1XFCNRJIZ7PHUNB4feCXTh+v4svk+VDz6AjK9XkBl4cJL9dCaZE3bsXpUViuOJ7oIHyPOfg+CHGVBaCNqWhC25MZ/m4eloFjHYC1fNgZ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Dq3U4hlPBeWFqAZcg5Ldx2NYBCaaa6NXg0lqlAOeyxxh8cztpScIkYSQ6JV3DzMz1hTST2Ct/OcmJi9VJXvQCfEOSyJFPC4wWaZq6dcPP378xAHOLusAm1TUht7NCcWtsM+DFEM8SblPiC7tYG8ghVzTLf1o6+2yiQyi4twdQpr4UWwCPyk7XL3RZ0D4bPpyv+eepB4toVyO83hTLkf57lo7BpSLz+JCMFyi5K2ccPl6CRqNR7TX330KIBp56Y69BsS48iVhfz4445itchHVtxxuY4kRywelXaCiG1XfknPNMpy/aY45kcNQ== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
enable bs > ps in XFS
|
expand
|
From: Pankaj Raghav <p.raghav@samsung.com> This is the second 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[1]. We also recorded a talk about this effort at LPC [3], if someone would like more context on this effort. A lot of emphasis has been put on testing using kdevops. The testing has been split into regression and progression. Regression testing: In regression testing, we ran the whole test suite 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 clusters 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.[4] 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 common failures upstream for bs=64k that needs to be fixed[5]. 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 [6], which I will be sending soon to the list. 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 v6.8-rc4 Vs v6.8-rc4 + these patches applied, and detected no regressions. We also wrote an eBPF tool called blkalgn [7] 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-rc5-v2 [1] https://lore.kernel.org/lkml/20230915183848.1018717-1-kernel@pankajraghav.com/ [2] https://lore.kernel.org/linux-xfs/20240213093713.1753368-1-kernel@pankajraghav.com/ [3] https://www.youtube.com/watch?v=ar72r5Xf7x4 [4] 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. [5] https://lore.kernel.org/linux-xfs/fe7fec1c-3b08-430f-9c95-ea76b237acf4@samsung.com/ [6] https://github.com/Panky-codes/xfstests/tree/lbs-fixes [7] https://github.com/iovisor/bcc/pull/4813 Changes since v1: - Round up to nearest min nr pages in ra_init - Calculate index in filemap_create instead of doing in filemap_get_pages - Remove unnecessary BUG_ONs in the delete path - Use check_shl_overflow instead of check_mul_overflow - Cast to uint32_t instead of unsigned long in xfs_stat_blksize Changes since RFC v2: - Move order 1 patch above the 1st patch - Remove order == 1 conditional in `fs: Allow fine-grained control of folio sizes`. This fixed generic/630 that was reported in the previous version. - Hide the max order and expose `mapping_set_folio_min_order` instead. - Add new helper mapping_start_index_align and DEFINE_READAHEAD_ALIGN - don't call `page_cache_ra_order` with min order in do_mmap_sync_readahead - simplify ondemand readahead with only aligning the start index at the end - Don't cap ra_pages based on bdi->io_pages - use `checked_mul_overflow` while calculating bytes in validate_fsb - Remove config lbs option - Add a warning while mounting a LBS kernel - Add Acked-by and Reviewed-by from Hannes and Darrick. 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 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: round up file_ra_state->ra_pages to mapping_min_nrpages readahead: align index to mapping_min_order in ondemand_ra and force_ra Matthew Wilcox (Oracle) (2): mm: Support order-1 folios in the page cache fs: Allow fine-grained control of folio sizes 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: 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/direct-io.c | 13 ++++- 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 | 10 +++- fs/xfs/xfs_super.c | 10 +--- include/linux/huge_mm.h | 7 ++- include/linux/pagemap.h | 110 ++++++++++++++++++++++++++++++------- mm/filemap.c | 35 ++++++++---- mm/huge_memory.c | 36 ++++++++++-- mm/internal.h | 4 +- mm/readahead.c | 73 +++++++++++++++++------- 13 files changed, 236 insertions(+), 78 deletions(-) base-commit: b401b621758e46812da61fa58a67c3fd8d91de0d