Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread safe about xio_send_request and xio_release_response #92

Open
terrs opened this issue Mar 23, 2016 · 2 comments
Open

Thread safe about xio_send_request and xio_release_response #92

terrs opened this issue Mar 23, 2016 · 2 comments

Comments

@terrs
Copy link

terrs commented Mar 23, 2016

Hi,

In nbdx_connect_work context, request will be sent in stack on_response->xio_release_response->xio_connection_xmit.

In nbdx_request context, request will be sent in stack
nbdx_transfer->xio_send_request->xio_connection_xmit.

Obviously, the two contexts are different, nbdx_connect_work
is xio connection context, nbdx_request is application context,
how to ensure xio send safely in this condition.

Thanks.

--haiwei.

@terrs
Copy link
Author

terrs commented Mar 26, 2016

Ok, maybe nobody met this bug, I paste more details and solution.

In tcp transport condition, there are xio context loop thread and application thread,
kernel_sendmsg in xio_tcp_xmit will be scheduled, so the two threads enter
xio_tcp_xmit repeatly, panic is coming cause tmp_work.msg_len is demaged.

get_cpu/put_cpu disable preempt, but not enought for kernel_sendmsg scheduled,
we need a flag to avoid calling xio_tcp_xmit repeatly by the two threads, though they
are running in same cpu.

@katyakats
Copy link
Collaborator

Nbdx is running over rdma, and we haven't tested it in tcp recently. Do you see this bug over rdma as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants