[Openais] [PATCH] Allocate buffers for packet transmission in the network drivers

Steven Dake sdake at redhat.com
Fri Mar 11 12:07:58 PST 2011


Zane,

Forwarding to list - I think you hit reply to instead of reply all :)

Regards
-steve
On 03/10/2011 07:42 PM, Zane Bitter wrote:
> 
> On 2011/03/10, at 03:04, Steven Dake wrote:
> 
>> This patch looks pretty good.
>>
>> One change that needs to be made before this patch can be merged is that
>> the transport drivers need to be aware of their own maximum frame sizes
>> and allocate accordingly.  Ie totemrrp_malloc() doesn't need a frame
>> size parameter, (but instead totemudp.c would allocate a frame size that
>> is appropriate for the transport (in the case of udp, something like 10k
>> would be safe).
> 
> Cool, can do. Thanks for the input.
> 
>> Another interesting idea that may be useful for a second patch is to
>> keep a list of freed frames to avoid the malloc/free overhead for the
>> common cases of totemsrp.  Surprisingly this is quite a significant
>> amount of overhead (according to oprofile).
>>
>> A totemnet_malloc operation would then be something like:
>>  if free_list has a frame, return frame and delete frame from free list
>> for the instance
>>  else malloc frame using transport driver
>> totemnet_free operation would be something like:
>>  add frame to free list
>>
>> To do this "slabbing" properly, a conditional parameter is probably
>> needed in the transport driver definition because totemnet_free for the
>> iba transport actually needs to call the free function (so it can be
>> reposted to the send queue).
> 
> Yes, or perhaps push it down into the drivers and have them call a common implementation of the free list? I guess one downside of that is that you end up with a separate pool for each driver. I'll keep it in mind; as you say, it's probably a separate patch.
> 
> cheers,
> Zane.
> 
>> Regards
>> -steve
> 



More information about the Openais mailing list