From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Eric Biggers <ebiggers@google.com>,
Keith Busch <kbusch@kernel.org>,
Christop Hellwig <hch@infradead.org>,
Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH 2/3] block: Introduce the BLK_FEAT_CALLS_BIO_SPLIT_TO_LIMITS flag
Date: Wed, 25 Jun 2025 16:42:58 -0700 [thread overview]
Message-ID: <20250625234259.1985366-3-bvanassche@acm.org> (raw)
In-Reply-To: <20250625234259.1985366-1-bvanassche@acm.org>
Introduce a flag that indicates whether or not bio_split_to_limits() is
called while processing a bio. Set this flag from inside
blk_mq_alloc_queue() because bio_split_to_limits() is called for all
request-based block drivers. This patch prepares for modifying when
__submit_bio() calls blk_crypto_bio_prep().
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
block/blk-mq.c | 3 ++-
include/linux/blkdev.h | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 532acdbe9e16..ab2fbc895a98 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4411,7 +4411,8 @@ struct request_queue *blk_mq_alloc_queue(struct blk_mq_tag_set *set,
if (!lim)
lim = &default_lim;
- lim->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT;
+ lim->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT |
+ BLK_FEAT_CALLS_BIO_SPLIT_TO_LIMITS;
if (set->nr_maps > HCTX_TYPE_POLL)
lim->features |= BLK_FEAT_POLL;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a51f92b6c340..108f70aa4d15 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -340,13 +340,17 @@ typedef unsigned int __bitwise blk_features_t;
#define BLK_FEAT_ATOMIC_WRITES \
((__force blk_features_t)(1u << 16))
+/* bio_split_to_limits() is called while processing a bio */
+#define BLK_FEAT_CALLS_BIO_SPLIT_TO_LIMITS ((__force blk_features_t)(1u << 17))
+
/*
* Flags automatically inherited when stacking limits.
*/
#define BLK_FEAT_INHERIT_MASK \
(BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA | BLK_FEAT_ROTATIONAL | \
BLK_FEAT_STABLE_WRITES | BLK_FEAT_ZONED | \
- BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE)
+ BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE | \
+ BLK_FEAT_CALLS_BIO_SPLIT_TO_LIMITS)
/* internal flags in queue_limits.flags */
typedef unsigned int __bitwise blk_flags_t;
next prev parent reply other threads:[~2025-06-25 23:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 23:42 [PATCH 0/3] Fix bio splitting in the crypto fallback code Bart Van Assche
2025-06-25 23:42 ` [PATCH 1/3] block: Split blk_crypto_fallback_split_bio_if_needed() Bart Van Assche
2025-06-25 23:42 ` Bart Van Assche [this message]
2025-06-26 5:24 ` [PATCH 2/3] block: Introduce the BLK_FEAT_CALLS_BIO_SPLIT_TO_LIMITS flag Christop Hellwig
2025-06-25 23:42 ` [PATCH 3/3] block: Rework splitting of encrypted bios Bart Van Assche
2025-06-26 5:28 ` Christop Hellwig
2025-07-10 18:04 ` Bart Van Assche
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=20250625234259.1985366-3-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=ebiggers@google.com \
--cc=hch@infradead.org \
--cc=kbusch@kernel.org \
--cc=linux-block@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 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.