[Pvfs2-developers] threaded client-core and the device thread

Murali Vilayannur murali.vilayannur at gmail.com
Tue Oct 24 00:52:57 EDT 2006


Hey Sam,
> I ran pvfs2-client-core in valgrind, and then ran Bonnie++ a few times 
> (10) on the mounted pvfs volume, and noticed the following when I 
> stopped the client process:
>
> ==20132== malloc/free: 1,298,824 allocs, 1,297,888 frees, 
> 3,462,517,583 bytes allocated.
>
> Allocating and freeing 3.5GB seemed extreme, so I went exploring.  It 
> turns out that every time we allocate a PINT_client_sm, we're 
> allocating about 35KB:
>
> (gdb) p sizeof(struct PINT_client_sm)
> $4 = 37764
Oh boy.. that is definitely large..
>   static array of 8 PINT_client_lookup_sm_ctx, which itself has a 
> static array 40 PINT_client_lookup_sm_segment, which are each about 
> 112 bytes.  Anyway, it ends up accumulating.
>
> So I'm convinced at this point that this is beyond the noise range, 
> plus its just cruft that we don't need.  I'd like to swap out those 
> static arrays for dynamic allocation when we get to the start of the 
> lookup state machine.  Any thoughts or suggestions?
I agree. It definitely does not look like noise region anymore.
How about we keep a pool of PINT_client_sm's around in client-core and 
allocate from that instead of dynamically allocating one everytime?

My 2 cents :)
thanks,
Murali


More information about the Pvfs2-developers mailing list