Re: [PATCH 05/18] io_uring: tie async worker side to the task context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



在 2021/2/20 下午10:38, Jens Axboe 写道:
On 2/20/21 1:11 AM, Hao Xu wrote:
@@ -8167,6 +8153,14 @@ static int io_uring_alloc_task_context(struct task_struct *task)
   		return ret;
   	}
+ tctx->io_wq = io_init_wq_offload(ctx);
+	if (IS_ERR(tctx->io_wq)) {
+		ret = PTR_ERR(tctx->io_wq);
+		percpu_counter_destroy(&tctx->inflight);
+		kfree(tctx);
+		return ret;
+	}
+
How about putting this before initing tctx->inflight so that
we don't need to destroy tctx->inflight in the error path?

Sure, but then we'd need to destroy the workqueue in the error path if
percpu_counter_init() fails instead.

Can you elaborate on why you think that'd be an improvement to the error
path?

You're right. I didn't realize it..



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux