[openib-general] Re: [PATCH] mad.c memory leak

Michael S. Tsirkin mst at mellanox.co.il
Wed Mar 15 12:29:07 PST 2006


Quoting r. Sean Hefty <mshefty at ichips.intel.com>:
> Subject: Re: [PATCH] mad.c memory leak
> 
> Michael S. Tsirkin wrote:
> >How about we track them per agent? Another a list will do it.
> >Could be a compile time debugging option if we want.
> 
> If we add reference counting per mad_agent, we may be able to figure out 
> which agent is not releasing their MADs.  I'm just not sure how easy it 
> would be to add the reference counting.

Shouldn't be hard: we need to add an agent pointer to MAD, init to NULL,
set this pointer and increment when we pass MAD to agent, and decrement when we
free it.

Probably a good idea to do this ifdef some debug flag - avoid the overhead
and as a form of documentation that its just a debug feature.

Could you look into this please?

> Can you describe what sort of testing you were doing to see this problem?  
> I've never run into it myself.
> 
> - Sean

Couldn't pin-point it yet.
Happens about each two days after stress testing the stack for some hours:
lots of queries, umad tools, IPoIB, restarting SM ...


-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies



More information about the general mailing list