[PATCH] clean the event context after fork in fork_domain_child()

boyang boyang at suse.de
Thu Jan 8 03:12:49 GMT 2009


Jeremy Allison wrote:
> On Thu, Jan 08, 2009 at 05:24:23AM +0800, boyang wrote:
>   
>> Jeremy Allison wrote:
>>     
>>> On Wed, Jan 07, 2009 at 05:39:17PM +0100, Stefan (metze) Metzmacher wrote:
>>>   
>>>       
>>>> boyang schrieb:
>>>>     
>>>>         
>>> Ok, I hate to be negative here, but I don't think this
>>> patch is needed. The original set of patches were
>>> essential as they caused actual bugs, in that the
>>> events were left active and could trigger inappropriately.
>>>
>>> This code tidies things up, but except for the fd
>>> closing doesn't really fix any bugs or resource leaks.
>>>   
>>>       
>> 1. Yes, It doesn't fix any bugs here.
>> 2. No, It causes resource leaks. If the memory is not used by child any
>> more, typiclally winbindd_clients_state() list, why should it be
>> remained?  does it possibly waste memory?
>> tidying thing up is not bad. :-)
>>     
>
> No true, but once we've forked all the original pages
> are left alone unless touched (in which case they have
> to be copy-on-write copied), so changing things we
> don't have to can be *more* wasteful, not less.
>   
It is true that there is one copy of content when both child and parent
just perform read access. The parent will absolutely write
winbindd_clients_state(), which cause pages copied for parent. and the
original one is left for child. therefore, there are two copies of it.
one for parent, and one for child, which is never used by child.

That is to say, parent will absolutely write the memory to incur two
copies of content, it doesn't matter whether child modifies them or not.
Free the unused copy is quite reasonable.
>   
>>> Back-porting the original fixes to 3.2 or 3.0 is
>>> probably more useful (IMHO).
>>>   
>>>       
>> I'll back port event context  and ticket refresh handler to 3.2 and 3.0
>> as soon as possible. :-)
>>     
>
> Thanks !
>
> Jeremy.
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: boyang.vcf
Type: text/x-vcard
Size: 187 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090108/f08254e5/boyang.vcf


More information about the samba-technical mailing list