From patchwork Sat Dec 14 03:10:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13908278 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 B8531E77183 for ; Sat, 14 Dec 2024 03:11:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E06876B008C; Fri, 13 Dec 2024 22:11:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CAA8B6B0093; Fri, 13 Dec 2024 22:11:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 79FE06B009A; Fri, 13 Dec 2024 22:11:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0B85D6B0098 for ; Fri, 13 Dec 2024 22:11:02 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 907431A148C for ; Sat, 14 Dec 2024 03:11:01 +0000 (UTC) X-FDA: 82892086704.01.F9359E7 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf27.hostedemail.com (Postfix) with ESMTP id BA7CF4000F for ; Sat, 14 Dec 2024 03:10:29 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=jn+VzRT6; spf=none (imf27.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=quarantine) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734145842; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=nVbdZFLburUKrMDxJT8VFegeQ4rw8dJVhDVUWKaEr00=; b=qo6QeDHGmOvh9yMbIM+y/79QyyRGMqnGsXPUvvEN40YpwEsIlDj4xLCD8ipL/jtT1TYbpu Xto0EFRTvFMyJ9NLg5bCiVJt6oviL5WUdGxG4oA2THy3A+tXwf+t5e/IMfFi/e1f/wKDh1 aToa8F2PgxFz5R+NtuzVDHq5y438ADM= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=jn+VzRT6; spf=none (imf27.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=quarantine) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734145842; a=rsa-sha256; cv=none; b=BibISm7c5ZcAngHL9tCsbgxRC0zd9TQ/IJ39QFflZruUyEexXiK2p6blKqQSgWpi0t9LOx pFLDWRNRfjG4Y302pPM6W+OfUu4sIpKRf16LS6UYXJlvIhe9VfBAZ7bmSAJZJXC4R7ibSB fjWwev8jGGEcsL4zrZ/hogoeIHia7S8= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=nVbdZFLburUKrMDxJT8VFegeQ4rw8dJVhDVUWKaEr00=; b=jn+VzRT6CVJfsvQPJRoW8mkloz GoZIpq7JSMgAM6DJmg02YZeZT4X6VBzvBiaADik7dCm/qFzpx3Y3HH1iDIjyN8cSZC5CEi1k5gjxc q+i72eyL65QnU8PUj4cofXYJZ2XwsGGDepXY5Q4vFrxwHW++dEgUclNB7IxTEkJrZWDiamgRa1SYc d1vycqPDazUd8/H+hOIIrndCmlzG+3kvq6LG3JVMfdUN6QHQLJpvEbeLdglqz/qBnOrzNrsP2Xvsy ZuByfAi2EHL26XH9FdtGWBjuewpDVKLys6UBzqDkVwqAB3Mt2HF2JiyEQ2x0ULx1qtrlod+yJwJDU HY9us9Ww==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tMIYN-00000005c3V-37oA; Sat, 14 Dec 2024 03:10:51 +0000 From: Luis Chamberlain To: willy@infradead.org, hch@lst.de, hare@suse.de, dave@stgolabs.net, david@fromorbit.com, djwong@kernel.org Cc: john.g.garry@oracle.com, ritesh.list@gmail.com, kbusch@kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, gost.dev@samsung.com, p.raghav@samsung.com, da.gomez@samsung.com, kernel@pankajraghav.com, mcgrof@kernel.org Subject: [RFC v2 00/11] enable bs > ps for block devices Date: Fri, 13 Dec 2024 19:10:38 -0800 Message-ID: <20241214031050.1337920-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: BA7CF4000F X-Stat-Signature: sxunfwo6x55843c7pthphteey8dxwozq X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam-User: X-Rspam: Yes X-HE-Tag: 1734145829-755768 X-HE-Meta: U2FsdGVkX18ZP3FvaT4kSonhiz7cMnTC2JHaIqTOUB5jSjCMcZ8oES4zUG91DmPCjAh4fnEGXd5xWOGMkqvsMqK/CZZZTxMfR41z4w+Ae7rFpSTg0f0ucOREo5SOnls09TOxbvIdwMiic5LSi4xvZH7DyxUxbaOSAZ1qtLxZYLpDi5VI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Ispvy/eFFyExIHDtQ2GDS+nJFFKn8uPdKLAf0BGqujCwYbsODnvzRvJ2qnrAjh2OnQxRzkjW1P7P4S9YWhfyFqnoLFBQeY8o2twxtBCcLTB2uVpGsRg0+aZU9l20HMVWrvRBTCD6vy2a+QIwUJ04EmOERwEQs4ukXmSzmhKKhqR/qlzIYkriOK9s6dRB1q54H3LziO2ZFTNJzeWFkAvsPVYc9xpnqaq+0JwMw8SfbiilqwFidb32X3UYiHtOgmToNTH4+A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000040, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Now that LBS is upstream on v6.12 and we have bs > ps for filesystems this address support for up bs > ps block devices. The first RFC v1 was posted [0] before the turkey massacre in the US. The changes on this v2 addrsess all the feedback from that series. The changes on this v2: - Simplfy with folio_pos() as suggested by Matthew Wilcox - To address support to reduce the buffer head array of size MAX_BUF_PER_PAGE to avoid stack growth growth warnings on systems with large base page sizes such as Hexagon with 256 KiB base page sizes I've added the async batch helper bh_read_batch_async() and iterator support for block_read_full_folio(). - Simplify the bdev_io_min() as suggested by Christoph Hellwig - Collect tags, and minor comment enhancements and remove new header inclusions where not actually needed This still goes out as RFCs as I'm still not done with my testing. As part of my test plan I'm including a baseline of ext4 as we're mucking around with buffer heads and testing xfs alone won't help to ensure we don't regress existing buffer head users. I'm also testing XFS with 32k sector size support given part of this enablement is to allow filesystems to also increase their support sector size. Patches 2-4 are really the meat and bones behind these changes and careful review is appreciated. I suspect a bit of bike shedding potential is in order there as well for those patches. If you'd like to help test this, this is available in the kdevops linux branch large-block-buffer-heads-for-next [1]. It is based on v6.13-rc2, and on that tree has a fix not yet merged on v6.13-rc2 which is required for LBS. That fix is already being tested and planned for v6.13-rc3, I carry since otherwise you wound't be able to mount any LBS filesystem with a filesystem block size larger than 16k. [0] https://lkml.kernel.org/r/20241113094727.1497722-1-mcgrof@kernel.org [1] https://github.com/linux-kdevops/linux/tree/large-block-buffer-heads-for-next Hannes Reinecke (3): fs/mpage: use blocks_per_folio instead of blocks_per_page fs/mpage: avoid negative shift for large blocksize block/bdev: enable large folio support for large logical block sizes Luis Chamberlain (8): fs/buffer: move async batch read code into a helper fs/buffer: add a for_each_bh() for block_read_full_folio() fs/buffer: add iteration support for block_read_full_folio() fs/buffer: reduce stack usage on bh_read_iter() fs/buffer fs/mpage: remove large folio restriction block/bdev: lift block size restrictions and use common definition nvme: remove superfluous block size check bdev: use bdev_io_min() for statx block size block/bdev.c | 13 +-- drivers/nvme/host/core.c | 10 -- fs/buffer.c | 209 +++++++++++++++++++++++++++------------ fs/mpage.c | 47 +++++---- include/linux/blkdev.h | 11 ++- 5 files changed, 187 insertions(+), 103 deletions(-)