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

glusterd: Optimize glusterd_volinfo_find function #1615

Closed
mohit84 opened this issue Oct 12, 2020 · 2 comments
Closed

glusterd: Optimize glusterd_volinfo_find function #1615

mohit84 opened this issue Oct 12, 2020 · 2 comments
Labels
wontfix Managed by stale[bot]

Comments

@mohit84
Copy link
Contributor

mohit84 commented Oct 12, 2020

Optimize glusterd_volinfo_find function, the function is use by multiple places to fetch volinfo object from a volumes list.
In case of brick_mux environment while too many volumes are configured it is not useful to compare everytime volume
based on volname.Instead of comparing again and again based on volname by strcmp save hash of volname in volinfo
object and compare the hash values.

int32_t
glusterd_volinfo_find(const char *volname, glusterd_volinfo_t **volinfo)
{
glusterd_volinfo_t *tmp_volinfo = NULL;
int32_t ret = -1;
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;

GF_ASSERT(volname);
this = THIS;
GF_ASSERT(this);

priv = this->private;
GF_ASSERT(priv);

cds_list_for_each_entry(tmp_volinfo, &priv->volumes, vol_list)
{
    if (!strcmp(tmp_volinfo->volname, volname)) {
        gf_msg_debug(this->name, 0, "Volume %s found", volname);
        ret = 0;
        *volinfo = tmp_volinfo;
        break;
    }
}

gf_msg_debug(this->name, 0, "Returning %d", ret);
return ret;

}

nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Oct 30, 2020
Added the code to use urcu hash table storing volinfos and updated
the glusterd_volinfo_find() to use hashing for finding the volumes.

This PR references issue gluster#1615

Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 8, 2021
Added the code to use urcu hash table storing volinfos and updated
the glusterd_volinfo_find() to use hashing for finding the volumes.

This PR references issue gluster#1615

Change-Id: Ifbadb63fde40c18851180b084e491a6f5958b366
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 8, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 8, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 19, 2021
Added the code to use urcu hash table storing volinfos and updated
the glusterd_volinfo_find() to use hashing for finding the volumes.

This PR references issue gluster#1615

Change-Id: Ifbadb63fde40c18851180b084e491a6f5958b366
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 19, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 19, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 19, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 20, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 20, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 20, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 20, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 20, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 20, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Jan 21, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Feb 22, 2021
Added the code to use urcu hash table storing volinfos and updated
the glusterd_volinfo_find() to use hashing for finding the volumes.

This PR references issue gluster#1615

Change-Id: Ifbadb63fde40c18851180b084e491a6f5958b366
Signed-off-by: nik-redhat <[email protected]>
nik-redhat added a commit to nik-redhat/glusterfs that referenced this issue Feb 22, 2021
Change-Id: I1cd0ef35bf421d6d3ff9a1e3aa4cb7d3be2df4dd
Fixes: gluster#1615
Signed-off-by: nik-redhat <[email protected]>
@stale
Copy link

stale bot commented May 12, 2021

Thank you for your contributions.
Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity.
It will be closed in 2 weeks if no one responds with a comment here.

@stale stale bot added the wontfix Managed by stale[bot] label May 12, 2021
@stale
Copy link

stale bot commented May 30, 2021

Closing this issue as there was no update since my last update on issue. If this is an issue which is still valid, feel free to open it.

@stale stale bot closed this as completed May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Managed by stale[bot]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant