From patchwork Wed Jan 25 13:34:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13115637 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 B3954C54EAA for ; Wed, 25 Jan 2023 13:35:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A8906B007B; Wed, 25 Jan 2023 08:34:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B50E6B007D; Wed, 25 Jan 2023 08:34:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E90F6B0081; Wed, 25 Jan 2023 08:34:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E97426B007E for ; Wed, 25 Jan 2023 08:34:57 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id AD2A2C0994 for ; Wed, 25 Jan 2023 13:34:57 +0000 (UTC) X-FDA: 80393417034.02.99F1D46 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf04.hostedemail.com (Postfix) with ESMTP id 0686840020 for ; Wed, 25 Jan 2023 13:34:55 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=nDXFh8LW; spf=none (imf04.hostedemail.com: domain of BATV+926f35216cf1e93e6ac9+7094+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+926f35216cf1e93e6ac9+7094+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674653696; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eatZ3C2tdEkdvrb64DPJf57lpiFsGds2EGzrS1xbOrI=; b=zdE1D+jttmMGSKOU3JJPkyBrE+ATYRBcT0NSWGvrhFlSL7jjxvBLPQUD9yDnu+HES8waxD eR9iy/juxZpQ5gA5n/rp/KF4rPiqz8azZdO+EqP0HN4MWZ2qPh354MYKf3VCIwctnv1fDp Do9TibW1W3PJd/55Qh3XJ/h8IJDMJzw= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=nDXFh8LW; spf=none (imf04.hostedemail.com: domain of BATV+926f35216cf1e93e6ac9+7094+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+926f35216cf1e93e6ac9+7094+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674653696; a=rsa-sha256; cv=none; b=AkRLdrs5PneYFA1oEsTwXDD40LgNByn5Blmis1IIB1AdrPN4Iu9AHSk12cBEFfHzIJWjnL 2l/U6HLO80Q/lhAwBcenMKFlHShziN7Ap3TupND9HyGB4NsdE83kncXBxgUUk+yO51YSKZ zmoT4pen3w3fzqg0V/RMVzdc1b4QMHo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=eatZ3C2tdEkdvrb64DPJf57lpiFsGds2EGzrS1xbOrI=; b=nDXFh8LWA1LGc5RQsEKZ0eXn4y OPVffqBjS24TQGQz3FdPT3r1QlObRWw1zBGgczQcuqrM0hVwHR1p0QQkfDBgl5PyOJyUC8uSlN6Wf BoqxcuHsf364qZ/DO7d/ayY38C4qDJBWDh+4mXV9yD9aEAhXVFcAw2z3K9tZvszL7qIpdy+dKJTYQ QOSZLn9G7dp+lkYy6obFD//bxcg0YVpfoFLdrw51es6H1n+EPKRp3mzEUMLp8a61KTfEmYnJBhZKf 4t0GUiY15/ca16Qlgzfa0UHylFIR51q2529/y2EoCY9/qv3XSmxpru60Gd0vznQCPMOXZAtAR4o/b gJyUIuNw==; Received: from [2001:4bb8:19a:27af:c78f:9b0d:b95c:d248] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKfvH-007P1T-Eg; Wed, 25 Jan 2023 13:34:44 +0000 From: Christoph Hellwig To: Jens Axboe , Minchan Kim , Sergey Senozhatsky , Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny Cc: Andrew Morton , linux-block@vger.kernel.org, nvdimm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/7] mpage: stop using bdev_{read,write}_page Date: Wed, 25 Jan 2023 14:34:30 +0100 Message-Id: <20230125133436.447864-2-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125133436.447864-1-hch@lst.de> References: <20230125133436.447864-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Stat-Signature: 9r999kem61zt39ywn7kwxhh6tfao767s X-Rspam-User: X-Rspamd-Queue-Id: 0686840020 X-Rspamd-Server: rspam06 X-HE-Tag: 1674653695-198292 X-HE-Meta: U2FsdGVkX1/vAo1ObwxnAmWeIvFJe3lvYSI7I44Ff1wFXkqRLV1/8xiCbNMzrSOL0JAsDLYOAnQxu3GGK1H18Q38qeKra7Yikxcf5kjdaIHWg1c+J5B3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nAiYs14fh+jMesAi1+KeAKkYMssRA69ylfyVbtZzFQ+siGC86di/33jEQrpBT8lON0CVi7ARrfyWuy/UBUdcoCLaoMnYcnIqZp+mXBXScqWjTh9+h3Aiw21azV04W+6r4ZzWn+zV1BMLIub8TFQ5lYxlfiYPZhQHiu5eFzAW8sle3f045E8MlJlwubsVlZRsdQWdAtOKDiyyx/1EvHBLpZY3R5MdKu8Z/wRH1ggRcsFY2ttV6+OG3WmLxY1TgRIRLWv5s92rxodoVDMnRiYviayUFFr3XXQ5Yb8i/VfsHSzIZG 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: These are micro-optimizations for synchronous I/O, which do not matter compared to all the other inefficiencies in the legacy buffer_head based mpage code. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- fs/mpage.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 0f8ae954a57903..124550cfac4a70 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -269,11 +269,6 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) alloc_new: if (args->bio == NULL) { - if (first_hole == blocks_per_page) { - if (!bdev_read_page(bdev, blocks[0] << (blkbits - 9), - &folio->page)) - goto out; - } args->bio = bio_alloc(bdev, bio_max_segs(args->nr_pages), opf, gfp); if (args->bio == NULL) @@ -579,11 +574,6 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc, alloc_new: if (bio == NULL) { - if (first_unmapped == blocks_per_page) { - if (!bdev_write_page(bdev, blocks[0] << (blkbits - 9), - page, wbc)) - goto out; - } bio = bio_alloc(bdev, BIO_MAX_VECS, REQ_OP_WRITE | wbc_to_write_flags(wbc), GFP_NOFS);