block: skip cgroups for passthrough io
authorKundan Kumar <kundan.kumar@samsung.com>
Mon, 18 Dec 2023 15:27:22 +0000 (20:57 +0530)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Dec 2023 16:46:53 +0000 (09:46 -0700)
Even if BLK_CGROUP is enabled, it does not work for passthrough io.
So skip setting up blkg for passthrough bio.

Reduced processing gives ~5% hike in peak-performance workload.

Signed-off-by: Kundan Kumar <kundan.kumar@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20231218152722.1768-1-joshi.k@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c

index 4b48c2c44098131328447f80172269657e64c2d0..58b13ef2382107543f3ce3e3de610482a1a5e6bf 100644 (file)
@@ -2064,6 +2064,9 @@ void bio_associate_blkg(struct bio *bio)
 {
        struct cgroup_subsys_state *css;
 
+       if (blk_op_is_passthrough(bio->bi_opf))
+               return;
+
        rcu_read_lock();
 
        if (bio->bi_blkg)