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

Narrow journal aio_lock locking scope in write_aio_bl #5670

Merged
merged 2 commits into from Dec 4, 2015

Conversation

david-z
Copy link
Member

@david-z david-z commented Aug 26, 2015

Aio io_submit in write_aio_bl with aio_lock might take long time to return, so write_finish_thread_entry can't process completed aio when io_submit is blocking. Try to narrow aio_lock locking scope to help those completed aio to get processed asap.

Fixes: #12789
Signed-off-by: Zhi Zhang zhangz.david@outlook.com

Aio io_submit in write_aio_bl with aio_lock might take long time to return, so write_finish_thread_entry can't process completed aio when io_submit is blocking. Try to narrow aio_lock locking scope to help those completed aio to get processed asap.

Signed-off-by: Zhi Zhang zhangz.david@outlook.com
@david-z
Copy link
Member Author

david-z commented Aug 28, 2015

@yuyuyu101

Haomai, can you pls take a look or schedule some one to do? Thanks.

@yuyuyu101
Copy link
Member

LGTM
I think we also could avoid extra new:
line 1414: iovec *iov = new iovec[max];

@david-z
Copy link
Member Author

david-z commented Aug 28, 2015

@yuyuyu101

Sorry, can you be more specific on avoiding extra new at line 1414?
I think bl.splice will reduce the length of original bl. If the length is still larger than 0, another aio should be generated. And we have to extra new iovec with current size and pass iovec to this aio because aio.iov needs to hold the pointer of this iovec until aio is done and freed.

@yuyuyu101
Copy link
Member

never mind, it's ok for this PR to reduce lock scope

@david-z
Copy link
Member Author

david-z commented Aug 28, 2015

thanks.

@yuyuyu101
Copy link
Member

LGTM

liewegas added a commit that referenced this pull request Dec 4, 2015
osd: FileJournal: reduce locking scope in write_aio_bl

Reviewed-by: Haomai Wang <haomai@xsky.com>
@liewegas liewegas merged commit 673d852 into ceph:master Dec 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants