Re: [PATCH 16/16] io_uring: return back safer resurrect

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

 





在 2021/5/10 17:15, Pavel Begunkov 写道:
On 5/10/21 3:22 AM, yangerkun wrote:
在 2021/4/11 8:46, Pavel Begunkov 写道:
Revert of revert of "io_uring: wait potential ->release() on resurrect",
which adds a helper for resurrect not racing completion reinit, as was
removed because of a strange bug with no clear root or link to the
patch.

Was improved, instead of rcu_synchronize(), just wait_for_completion()
because we're at 0 refs and it will happen very shortly. Specifically
use non-interruptible version to ignore all pending signals that may
have ended prior interruptible wait.

This reverts commit cb5e1b81304e089ee3ca948db4d29f71902eb575.

Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>

I have a question. Compare with the logical before this patch. We need call reinit_completion(&ctx->ref_comp) to make sure the effective use of the ref_comp.

Does we forget to do this? Or I miss something?
If percpu_ref_tryget() there succeeds, it should have not called
complete by design, otherwise it do complete once (+1 completion
count) following with a single wait(-1 completion count), so +1 -1
should return it back to zero. See how struct completion works,
e.g. completion.rst, number of completions is counted inside.

Got it. Thanks for your explain!


btw, you have a strange mail encoding, apparently it's not Unicode

Yeah... I have change to Unicode!

Thanks,
Kun.




[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