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: Prealloc memory avoid realloc in list_collection. #18804

Merged
merged 1 commit into from Feb 9, 2018

Conversation

majianpeng
Copy link
Member

Signed-off-by: Jianpeng Ma jianpeng.ma@intel.com

@@ -7121,6 +7121,7 @@ int BlueStore::getattrs(

int BlueStore::list_collections(vector<coll_t>& ls)
{
ls.reserve(coll_map.size());
RWLock::RLocker l(coll_lock);
Copy link
Member

Choose a reason for hiding this comment

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

can you move this down a line under the coll_lock? It's not safe to call size() outside of the lock.

Copy link
Member Author

Choose a reason for hiding this comment

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

alloc memory may need long time and i don't hope by coll_lock. And if size() increase is small conceptual event. We don't consider this.

@majianpeng
Copy link
Member Author

update by your suggestion.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
@tchaikov
Copy link
Contributor

tchaikov commented Feb 9, 2018

the failures are either caused by #19117 or tracked by http://tracker.ceph.com/issues/9356 .

@tchaikov tchaikov merged commit 34c3af4 into ceph:master Feb 9, 2018
@majianpeng majianpeng deleted the bluestore-collection-prealloc branch February 9, 2018 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants