lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/3] block: cache bdev in struct file for raw bdev IO
On Wed, Oct 13, 2021 at 09:57:11AM +0100, Pavel Begunkov wrote:
> bdev = &BDEV_I(file->f_mapping->host)->bdev
>
> Getting struct block_device from a file requires 2 memory dereferences
> as illustrated above, that takes a toll on performance, so cache it in
> yet unused file->private_data. That gives a noticeable peak performance
> improvement.
>
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
> block/fops.c | 29 +++++++++++++----------------
> 1 file changed, 13 insertions(+), 16 deletions(-)
>
> diff --git a/block/fops.c b/block/fops.c
> index 7bb9581a146c..c71e91cd6bcb 100644
> --- a/block/fops.c
> +++ b/block/fops.c
> @@ -17,7 +17,7 @@
> #include <linux/fs.h>
> #include "blk.h"
>
> -static struct inode *bdev_file_inode(struct file *file)
> +static inline struct inode *bdev_file_inode(struct file *file)
> {
> return file->f_mapping->host;
> }

This is unrelated to the rest.

But the actual described change looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

\
 
 \ /
  Last update: 2021-10-13 17:22    [W:0.142 / U:1.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site