From: Jens Axboe Date: Wed, 11 Aug 2021 16:19:06 +0000 (-0600) Subject: block: clear BIO_PERCPU_CACHE flag if polling isn't supported X-Git-Tag: io_uring-bio-cache.5-2021-08-30~4 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=be863b9e4348a791e360d25611a1bdde2c9595ed;p=linux-2.6-block.git block: clear BIO_PERCPU_CACHE flag if polling isn't supported The bio alloc cache relies on the fact that a polled bio will complete in process context, clear the cacheable flag if we disable polling for a given bio. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/block/blk-core.c b/block/blk-core.c index 4f8449b29b21..0d4d6b1e5d25 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -832,8 +832,11 @@ static noinline_for_stack bool submit_bio_checks(struct bio *bio) } } - if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags)) + if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags)) { + /* can't support alloc cache if we turn off polling */ + bio_clear_flag(bio, BIO_PERCPU_CACHE); bio->bi_opf &= ~REQ_HIPRI; + } switch (bio_op(bio)) { case REQ_OP_DISCARD: