From patchwork Wed Dec 18 02:26:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13912929 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 3B331E77187 for ; Wed, 18 Dec 2024 02:26:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A8226B0089; Tue, 17 Dec 2024 21:26:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 630AF6B0092; Tue, 17 Dec 2024 21:26:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 214066B0089; Tue, 17 Dec 2024 21:26:34 -0500 (EST) 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 B25B46B0089 for ; Tue, 17 Dec 2024 21:26:34 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5FAB0140AD2 for ; Wed, 18 Dec 2024 02:26:34 +0000 (UTC) X-FDA: 82906490352.15.1751825 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf25.hostedemail.com (Postfix) with ESMTP id 5A02CA0009 for ; Wed, 18 Dec 2024 02:26:10 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Voh8Sf3h; spf=none (imf25.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=1734488763; a=rsa-sha256; cv=none; b=IWA0qzLvNNyjyBTYWzk1O8Q0TjPCCKm6NjW2sTTzv4edG0ew7+Ep6cawGYhqCbSf1DkZEx mTL9HBXzkZm4w5q+D6Lo9hiwzkelEohfgu3YTEnaLvv0bwnMMlXyDMUe2C/hLG1ZUJZdJI EjwpQTRm2qRvhOwNvuPDVXq2o3MiTzA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Voh8Sf3h; spf=none (imf25.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=1734488763; 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=zQboEwj/BnkbLUHNu4i0H6IOdbozIVeO6wUMyrdIBHI=; b=mgTbuc9lh7+iSpX+2LGNak1Gk5BvAdaFBRDDR0Hjty6nKYXzx4ksNkt8/dsx/FE5SYGmX9 9J1jkXPeDWry234vTcJZwkjRQnXFIXTNX5ic6HQ4Mm+pJl1BBITV7tdZ8zBGNNTxAzpwNb wMws4En12JFUn+pAsMIb9Dgl/FYGYjQ= 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=zQboEwj/BnkbLUHNu4i0H6IOdbozIVeO6wUMyrdIBHI=; b=Voh8Sf3hO5qNkjoK4kIPOmOgEK KymmqwZVrqKkrljZN2JeD/OQLToc1A8LNRhRuBTBcPfbdAjjEzWuJ0LI2x9XlHWHr0WNa/9gP3bmK zd/YOrMgYy0ipBfnPr2D5RvFIFhc+nIZlwXW24TC/hW1DZnmuFQJQHv9RyMQLlhXUmtieqhNiet0b CyRsUC2rLKtSQBiFM6gspK2m69dbsrPc6kP2MdZISh3XhokfJdRGmnOFlJBIu4h3mH1CigDN/cOY2 ckLuHCIjOl51/DOGdhElWBRqoxI49t8/r5R74GfUuj6zq5qeTQDZOPnD3dIda6xFV7Jn/oknafRHJ IFScGQ0A==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tNjlc-0000000FOFQ-0omO; Wed, 18 Dec 2024 02:26:28 +0000 From: Luis Chamberlain To: hare@suse.de, willy@infradead.org, dave@stgolabs.net, david@fromorbit.com, djwong@kernel.org, kbusch@kernel.org Cc: john.g.garry@oracle.com, hch@lst.de, ritesh.list@gmail.com, 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: [PATCH 0/5] fs/buffer: strack reduction on async read Date: Tue, 17 Dec 2024 18:26:21 -0800 Message-ID: <20241218022626.3668119-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 5A02CA0009 X-Stat-Signature: iwx9oxmgng9sor7n3qtd5urrpwe5m87y X-Rspam-User: X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspamd-Server: rspam09 X-Rspam: Yes X-HE-Tag: 1734488770-897059 X-HE-Meta: U2FsdGVkX19pgmqbnCvLHGnCs4P4FTX68twW+8+ZUquFwSz2fCKYmZoTtLcYPKUGnHeE1lPLip6sOxCQFI9KcUmm18JyJKPVZLIn+CycZ/rQ4rZv4d9Tr8va70FmnqXp2HRDarwpEUvW2u43jjgnZ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76WgzIr+jaZEvwvG1FEX0FoAfdobLr3MNYjVDZrH/urfn7zixuTNjvSbCwiz4R4qW1mEk6UEuMro+PqC4/GyisYXVe4Jo6MZLVdUvYrFDrt4gvdL+91MzwbVlbvJ8FCCATN758RMiNkbbDAPiNi6v0ymQHIbbIFSA+m5V/4UtkF+RlGP4df4IkUG3uSF/uaU5obI21ZHTcc1Smt2ztHXIs59JoL09lT+K7z4YfJlYOlQV8Ip5YOgPT9UsrcT4FZpD2EAJ4Qb9w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000739, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This splits up a minor enhancement from the bs > ps device support series into its own series for better review / focus / testing. This series just addresses the reducing the array size used and cleaning up the async read to be easier to read and maintain. Changes on this series from the RFC v2: - Fixes the loop by ensuring we bump counts on continue as noted by Matthew Wilcox - new patch to simplify the loop by using bh_offset() - bike shed love on comments - Testing: tested on ext4 and XFS with fstests, with no regressions found after willy's suggested loop fix on continue. I'm however running a new set of tests now after a rebase onto v6.13-rc3 and a bit of patch ordering and the addition of bh_offset(). Prelimimary tests however show no issues. [0] https://lkml.kernel.org/r/20241214031050.1337920-1-mcgrof@kernel.org Luis Chamberlain (5): fs/buffer: move async batch read code into a helper fs/buffer: simplify block_read_full_folio() with bh_offset() 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.c | 221 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 160 insertions(+), 61 deletions(-)