[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0785c707-ba82-1e46-5d4d-63ccacdb471f@kernel.dk>
Date: Sat, 9 Oct 2021 10:33:17 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Pavel Begunkov <asml.silence@...il.com>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] block: cache bdev in struct file for raw bdev IO
On 10/9/21 6:25 AM, 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.
It's hilariously bad right now, so I really welcome this change. One
comment:
> +static inline struct block_device *blkdev_get_bdev(struct file *file)
> +{
> + return file->private_data;
> +}
Get rid of this and just use bdev = file->private_data where
appropriate. Easier to read, we don't need to hide this in a function.
--
Jens Axboe
Powered by blists - more mailing lists