mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	direct-io: remove random prefetches
Randomly poking into block device internals for manual prefetches isn't exactly a very maintainable thing to do. And none of the performance critical direct I/O implementations still use this library function anyway, so just drop it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Link: https://lore.kernel.org/r/20220415045258.199825-28-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
		
							parent
							
								
									44abff2c0b
								
							
						
					
					
						commit
						c22198e78d
					
				
					 1 changed files with 4 additions and 28 deletions
				
			
		|  | @ -1115,8 +1115,7 @@ 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, | ||||
| 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) | ||||
|  | @ -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) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Christoph Hellwig
						Christoph Hellwig