Re: [PATCH] Allocate cpg_dispatch message buffer in heap instead of stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



José Orlando Pereira napsal(a):
> On Friday 19 April 2013 12:36:15 Jan Friesse wrote:
>> Jose,
>> I was thinking about that problem a little deeper and what about
>> implementing this:
>> - Store buffer in cpg_inst (so alloc in cpg_initialize, free in
>> cpg_finalize)
>> - When dispatch is called, set variable in cpg_inst (something like
>> is_in_dispatch) before callback and unset it after callback.
>> - IF is_in_dispatch is set, allocate new buffer, else use buffer from
>> cpg_inst
>>
>> Basically, this should solve all problems with (in practice) no perf
>> hit, because 99.9999% code doesn't reenter *_dispatch function, and make
>> rest of 0.0001% code work correctly.
> 
> A tentative patch is attached, just for cpg for now. Freeing in finalize
> is a bit tricky, as dispatch might still be running.
> 
> But this seems to be too much trouble when there is a decent workaround
> (i.e., changing JVM's stack size with a simple command line parameter)
> for my initial problem. So, I'm not pushing very hard for this
> to get accepted.
> 

Thanks a lot for your patch. We are currently analyzing two different
solutions:
- libqb dispatch functions returns raw pointer to buffer (instead of
copy). This would mean no stack needed (and maybe also little speedup
improvement)
- Disallow reentrant call of *_dispatch functions (so again no stack needed)

I will definitively let you know results.

Thanks again for patch.

Regards,
  Honza
_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss





[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux