ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: jfs-discussion@lists.sourceforge.net,
	linux-nvme@lists.infradead.org,
	virtualization@lists.linux-foundation.org, linux-mm@kvack.org,
	dm-devel@redhat.com, target-devel@vger.kernel.org,
	linux-mtd@lists.infradead.org, drbd-dev@lists.linbit.com,
	linux-s390@vger.kernel.org, linux-nilfs@vger.kernel.org,
	linux-scsi@vger.kernel.org, cluster-devel@redhat.com,
	xen-devel@lists.xenproject.org, linux-ext4@vger.kernel.org,
	linux-um@lists.infradead.org, nbd@other.debian.org,
	linux-block@vger.kernel.org, linux-bcache@vger.kernel.org,
	ceph-devel@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-mmc@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-xfs@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev,
	linux-btrfs@vger.kernel.org
Subject: [Ocfs2-devel] [PATCH 27/27] direct-io: remove random prefetches
Date: Fri, 15 Apr 2022 06:52:58 +0200	[thread overview]
Message-ID: <20220415045258.199825-28-hch@lst.de> (raw)
In-Reply-To: <20220415045258.199825-1-hch@lst.de>

Randomly poking into block device internals for manual prefetches isn't
exactly a very maintainable thing to do.  And none of the performance
criticil direct I/O implementations still use this library function
anyway, so just drop it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/direct-io.c | 32 ++++----------------------------
 1 file changed, 4 insertions(+), 28 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index aef06e607b405..840752006f601 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1115,11 +1115,10 @@ static inline int drop_refcount(struct dio *dio)
  * individual fields and will generate much worse code. This is important
  * for the whole file.
  */
-static inline ssize_t
-do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
-		      struct block_device *bdev, struct iov_iter *iter,
-		      get_block_t get_block, dio_iodone_t end_io,
-		      dio_submit_t submit_io, int flags)
+ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
+		struct block_device *bdev, struct iov_iter *iter,
+		get_block_t get_block, dio_iodone_t end_io,
+		dio_submit_t submit_io, int flags)
 {
 	unsigned i_blkbits = READ_ONCE(inode->i_blkbits);
 	unsigned blkbits = i_blkbits;
@@ -1334,29 +1333,6 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
 	kmem_cache_free(dio_cache, dio);
 	return retval;
 }
-
-ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
-			     struct block_device *bdev, struct iov_iter *iter,
-			     get_block_t get_block,
-			     dio_iodone_t end_io, dio_submit_t submit_io,
-			     int flags)
-{
-	/*
-	 * The block device state is needed in the end to finally
-	 * submit everything.  Since it's likely to be cache cold
-	 * prefetch it here as first thing to hide some of the
-	 * latency.
-	 *
-	 * Attempt to prefetch the pieces we likely need later.
-	 */
-	prefetch(&bdev->bd_disk->part_tbl);
-	prefetch(bdev->bd_disk->queue);
-	prefetch((char *)bdev->bd_disk->queue + SMP_CACHE_BYTES);
-
-	return do_blockdev_direct_IO(iocb, inode, bdev, iter, get_block,
-				     end_io, submit_io, flags);
-}
-
 EXPORT_SYMBOL(__blockdev_direct_IO);
 
 static __init int dio_init(void)
-- 
2.30.2


_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

  parent reply	other threads:[~2022-04-15  4:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15  4:52 [Ocfs2-devel] use block_device based APIs in block layer consumers v3 Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 03/27] target: fix discard alignment on partitions Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 04/27] drbd: remove assign_p_sizes_qlim Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 06/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 07/27] drbd: cleanup decide_on_discard_support Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 09/27] ntfs3: use bdev_logical_block_size instead of open coding it Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 10/27] mm: use bdev_is_zoned in claim_swapfile Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 13/27] block: add a bdev_fua helper Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 14/27] block: add a bdev_stable_writes helper Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 16/27] block: use bdev_alignment_offset in part_alignment_offset_show Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 19/27] block: remove queue_discard_alignment Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 20/27] block: use bdev_discard_alignment in part_discard_alignment_show Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` [Ocfs2-devel] [PATCH 21/27] block: move {bdev, queue_limit}_discard_alignment out of line Christoph Hellwig via Ocfs2-devel
2022-04-15  4:52 ` Christoph Hellwig via Ocfs2-devel [this message]
2022-04-18 12:52 ` [Ocfs2-devel] use block_device based APIs in block layer consumers v3 Jens Axboe via Ocfs2-devel
  -- strict thread matches above, loose matches on Subject: below --
2022-04-09  4:50 [Ocfs2-devel] use block_device based APIs in block layer consumers v2 Christoph Hellwig via Ocfs2-devel
2022-04-09  4:50 ` [Ocfs2-devel] [PATCH 27/27] direct-io: remove random prefetches Christoph Hellwig via Ocfs2-devel
2022-04-06  6:04 [Ocfs2-devel] use block_device based APIs in block layer consumers Christoph Hellwig via Ocfs2-devel
2022-04-06  6:05 ` [Ocfs2-devel] [PATCH 27/27] direct-io: remove random prefetches Christoph Hellwig via Ocfs2-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220415045258.199825-28-hch@lst.de \
    --to=ocfs2-devel@oss.oracle.com \
    --cc=axboe@kernel.dk \
    --cc=ceph-devel@vger.kernel.org \
    --cc=cluster-devel@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=hch@lst.de \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=nbd@other.debian.org \
    --cc=ntfs3@lists.linux.dev \
    --cc=target-devel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).