From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Damien Le Moal <dlemoal@kernel.org>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Yi Zhang <yi.zhang@redhat.com>,
Ye Bin <yebin10@huawei.com>
Subject: Re: [PATCH] block: check bio alignment in blk_mq_submit_bio
Date: Wed, 19 Jun 2024 16:29:36 +0800 [thread overview]
Message-ID: <ZnKW8MAekDIMJyBS@fedora> (raw)
In-Reply-To: <ZnKRiG0PKxPzQrcb@infradead.org>
On Wed, Jun 19, 2024 at 01:06:32AM -0700, Christoph Hellwig wrote:
> On Wed, Jun 19, 2024 at 03:58:37PM +0800, Ming Lei wrote:
> > > > unsigned int bs_mask = queue_logical_block_size(q) - 1;
> > >
> > > Please avoid use of the queue helpers. This should be:
> > >
> > > unsigned int bs_mask = bdev_logical_block_size(bio->bi_bdev);
> >
> > It is one blk-mq internal helper, I think queue helper is more
> > efficient since it is definitely in fast path.
>
> Does it actually generate different code for you with all the inlining
> modern compilers do?
It is hard to answer, cause there are so many compilers(versions).
I definitely agree bdev_logical_block_size() should be used in external
users, but it is fine to use queue helper in block internal functions.
thanks,
Ming
next prev parent reply other threads:[~2024-06-19 8:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 3:34 [PATCH] block: check bio alignment in blk_mq_submit_bio Ming Lei
2024-06-19 4:14 ` Damien Le Moal
2024-06-19 4:22 ` Damien Le Moal
2024-06-19 7:33 ` Christoph Hellwig
2024-06-19 7:58 ` Ming Lei
2024-06-19 8:06 ` Christoph Hellwig
2024-06-19 8:29 ` Ming Lei [this message]
2024-06-19 7:56 ` Ming Lei
2024-06-19 8:05 ` Christoph Hellwig
2024-06-19 8:37 ` Ming Lei
2024-06-19 7:50 ` Hannes Reinecke
2024-06-19 8:02 ` Ming Lei
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=ZnKW8MAekDIMJyBS@fedora \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=yebin10@huawei.com \
--cc=yi.zhang@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.