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

os/bluestore: shrink aio submit size to pending value #17588

Merged
merged 1 commit into from Sep 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/os/bluestore/KernelDevice.cc
Expand Up @@ -520,7 +520,7 @@ void KernelDevice::aio_submit(IOContext *ioc)
void *priv = static_cast<void*>(ioc);
int r, retries = 0;
r = aio_queue.submit_batch(ioc->running_aios.begin(), e,
ioc->num_running.load(), priv, &retries);
pending, priv, &retries);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correct, you mean some IOs will be submit more than ones in old code. Right?

Copy link
Author

@kungf kungf Sep 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, sorry for confused. I am not mean that, i mean there are some memory waste in struct iocb *piocb[aios_size] in submit_batch funtion.
ios were submitted from running_aios.begin() to e, no old ios were submitted. but the total io size should be pending size, but it passed num_running.load() as aios_size to aio_submit(), num_running.load >=pending, num_running.load() may be very large, so it will make memory waste, am i describe clear?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you really meet this case during test?


if (retries)
derr << __func__ << " retries " << retries << dendl;
Expand Down
1 change: 1 addition & 0 deletions src/os/bluestore/aio.cc
Expand Up @@ -46,6 +46,7 @@ int aio_queue_t::submit_batch(aio_iter begin, aio_iter end,
++left;
++cur;
}
assert(aios_size >= left);
int done = 0;
while (left > 0) {
int r = io_submit(ctx, left, piocb + done);
Expand Down