From: Christoph Hellwig <hch@infradead.org>
To: Sergei Shtepa <sergei.shtepa@linux.dev>
Cc: axboe@kernel.dk, hch@infradead.org, corbet@lwn.net,
snitzer@kernel.org, mingo@redhat.com, peterz@infradead.org,
juri.lelli@redhat.com, viro@zeniv.linux.org.uk,
brauner@kernel.org, linux-block@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
Sergei Shtepa <sergei.shtepa@veeam.com>,
Donald Buczek <buczek@molgen.mpg.de>,
Fabio Fantoni <fantonifabio@tiscali.it>
Subject: Re: [PATCH v6 02/11] block: Block Device Filtering Mechanism
Date: Wed, 6 Dec 2023 23:44:29 -0800 [thread overview]
Message-ID: <ZXF33Q9TpF4kBXP0@infradead.org> (raw)
In-Reply-To: <20231124165933.27580-3-sergei.shtepa@linux.dev>
> + struct request_queue *q = bdev_get_queue(bio->bi_bdev);
> + bool skip_bio = false;
> +
> + if (unlikely(bio_queue_enter(bio)))
> + return;
> +
> + if (bio->bi_bdev->bd_filter &&
> + bio->bi_bdev->bd_filter != current->blk_filter) {
> + struct blkfilter *prev = current->blk_filter;
> +
> + current->blk_filter = bio->bi_bdev->bd_filter;
> + skip_bio = bio->bi_bdev->bd_filter->ops->submit_bio(bio);
> + current->blk_filter = prev;
> + }
> +
> + blk_queue_exit(q);
This currently adds a queue enter/exit pair even if no filter driver
is used, which іs probably not acceptable. We probably need some
way to avoid the check in the fast path. In general an unlocked check
for bio->bi_bdev->bd_filter outside the protection seems fine to here,
we just need to find a good way to make sure it is visible by the
time a filter is actually set and the filter driver initialization.
> if (!bio->bi_bdev->bd_has_submit_bio) {
> blk_mq_submit_bio(bio);
> - } else if (likely(bio_queue_enter(bio) == 0)) {
> + return;
> + }
> +
> + if (likely(bio_queue_enter(bio) == 0)) {
This is just stray reformatting and we can drop it.
next prev parent reply other threads:[~2023-12-07 7:44 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-24 16:59 [PATCH v6 00/11] blksnap - block devices snapshots module Sergei Shtepa
2023-11-24 16:59 ` [PATCH v6 01/11] documentation: Block Device Filtering Mechanism Sergei Shtepa
2023-11-24 16:59 ` [PATCH v6 02/11] block: " Sergei Shtepa
2023-12-07 7:44 ` Christoph Hellwig [this message]
2023-12-07 11:22 ` Sergei Shtepa
2023-11-24 16:59 ` [PATCH v6 03/11] documentation: Block Devices Snapshots Module Sergei Shtepa
2023-11-24 16:59 ` [PATCH v6 04/11] blksnap: header file of the module interface Sergei Shtepa
2023-11-24 16:59 ` [PATCH v6 05/11] blksnap: module management interface functions Sergei Shtepa
2023-11-24 16:59 ` [PATCH v6 06/11] blksnap: handling and tracking I/O units Sergei Shtepa
2023-12-07 8:23 ` Christoph Hellwig
2023-11-24 16:59 ` [PATCH v6 07/11] blksnap: difference storage and chunk Sergei Shtepa
2023-12-07 8:36 ` Christoph Hellwig
2023-11-24 16:59 ` [PATCH v6 08/11] blksnap: event queue from the difference storage Sergei Shtepa
2023-11-24 16:59 ` [PATCH v6 09/11] blksnap: snapshot and snapshot image block device Sergei Shtepa
2023-11-24 16:59 ` [PATCH v6 10/11] blksnap: Kconfig and Makefile Sergei Shtepa
2023-12-07 7:47 ` Christoph Hellwig
2023-11-24 16:59 ` [PATCH v6 11/11] blksnap: prevents using devices with data integrity or inline encryption Sergei Shtepa
2023-11-27 22:47 ` Eric Biggers
2023-11-28 11:00 ` Sergei Shtepa
2023-11-28 17:18 ` Eric Biggers
2023-11-29 15:15 ` Sergei Shtepa
2023-11-24 17:03 ` [PATCH v6 00/11] blksnap - block devices snapshots module Jens Axboe
2023-11-24 17:12 ` Sergei Shtepa
-- strict thread matches above, loose matches on Subject: below --
2023-11-24 16:38 Sergei Shtepa
2023-11-24 16:38 ` [PATCH v6 02/11] block: Block Device Filtering Mechanism Sergei Shtepa
2023-11-24 16:04 [PATCH v6 00/11] blksnap - block devices snapshots module Sergei Shtepa
2023-11-24 16:04 ` [PATCH v6 02/11] block: Block Device Filtering Mechanism Sergei Shtepa
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=ZXF33Q9TpF4kBXP0@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=buczek@molgen.mpg.de \
--cc=corbet@lwn.net \
--cc=fantonifabio@tiscali.it \
--cc=juri.lelli@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sergei.shtepa@linux.dev \
--cc=sergei.shtepa@veeam.com \
--cc=snitzer@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).