diff mbox series

block: skip cgroups for passthrough io

Message ID 20231218152722.1768-1-joshi.k@samsung.com (mailing list archive)
State New, archived
Headers show
Series block: skip cgroups for passthrough io | expand

Commit Message

Kanchan Joshi Dec. 18, 2023, 3:27 p.m. UTC
From: Kundan Kumar <kundan.kumar@samsung.com>

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>
---
 block/blk-cgroup.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Keith Busch Dec. 18, 2023, 4:08 p.m. UTC | #1
On Mon, Dec 18, 2023 at 08:57:22PM +0530, Kanchan Joshi wrote:
> From: Kundan Kumar <kundan.kumar@samsung.com>
> 
> 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.

Looks good. Our passthrough commands still need to call bio_set_dev()
for integrity data, so this is type of check is the easiest way to avoid
the overhead.

Reviewed-by: Keith Busch <kbusch@kernel.org>
Jens Axboe Dec. 18, 2023, 4:47 p.m. UTC | #2
On Mon, 18 Dec 2023 20:57:22 +0530, Kanchan Joshi wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] block: skip cgroups for passthrough io
      commit: 6c9b97085c473e380e57cf33c95d2c74444b2a5d

Best regards,
diff mbox series

Patch

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 4b48c2c44098..58b13ef23821 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -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)