-
gf_mem_acct_fini() is checking if acct->refcnt is 0 and if so, frees the mem_acct structure . However, acct->refcnt is initialized to 1, is always incremented on allocation and is decremented in gf_mem_acct_fini() - so I don't see how it'll ever reach 0. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
@mohit84 - might be relevant for your lockless memory accounting patch. |
Beta Was this translation helpful? Give feedback.
-
I think you are saying about xlator_mem_acct_unref, i am not able to find any function (gf_mem_acct_fini).The xlator function is applicable to release mem_acct, we do call xlator_mem_acct_unref two times 1) at the time of calling __gf_free and 2) at the time |
Beta Was this translation helpful? Give feedback.
-
Thanks, I got slightly confused, and you've corrected it well, but I still don't see how in _gf_free() it'll ever clear anything, let me try again:
|
Beta Was this translation helpful? Give feedback.
-
So we can remove:
from __gf_free() |
Beta Was this translation helpful? Give feedback.
Thanks, I got slightly confused, and you've corrected it well, but I still don't see how in _gf_free() it'll ever clear anything, let me try again: