From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] block: cache bdev in struct file for raw bdev IO
Date: Sat, 9 Oct 2021 10:33:17 -0600 [thread overview]
Message-ID: <0785c707-ba82-1e46-5d4d-63ccacdb471f@kernel.dk> (raw)
In-Reply-To: <cfc66d9946422fa1778504f976621c91be2befb5.1633781740.git.asml.silence@gmail.com>
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
next prev parent reply other threads:[~2021-10-09 16:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-09 12:25 [PATCH 0/6] some block optimisations Pavel Begunkov
2021-10-09 12:25 ` [PATCH 1/6] block: cache bdev in struct file for raw bdev IO Pavel Begunkov
2021-10-09 16:33 ` Jens Axboe [this message]
2021-10-11 8:26 ` Christoph Hellwig
2021-10-13 8:45 ` Pavel Begunkov
2021-10-09 12:25 ` [PATCH 2/6] block: inline BDEV_I and friends Pavel Begunkov
2021-10-11 8:20 ` Christoph Hellwig
2021-10-09 12:25 ` [PATCH 3/6] blk-mq: optimise *end_request non-stat path Pavel Begunkov
2021-10-09 12:25 ` [PATCH 4/6] block: inline hot paths of blk_account_io_*() Pavel Begunkov
2021-10-09 12:25 ` [PATCH 5/6] blk-mq: inline hot part of __blk_mq_sched_restart Pavel Begunkov
2021-10-09 12:25 ` [PATCH 6/6] block: convert ->bd_inode to container_of() Pavel Begunkov
2021-10-11 8:32 ` Christoph Hellwig
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=0785c707-ba82-1e46-5d4d-63ccacdb471f@kernel.dk \
--to=axboe@kernel.dk \
--cc=asml.silence@gmail.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®