[Freeipa-devel] [PATCH 0067] Use stack allocation when writing values during otp auth

Martin Kosek mkosek at redhat.com
Tue Sep 30 06:28:40 UTC 2014


On 09/29/2014 06:01 PM, thierry bordaz wrote:
> On 09/29/2014 05:45 PM, Nathaniel McCallum wrote:
>> On Thu, 2014-09-25 at 13:45 +0200, thierry bordaz wrote:
>>> On 09/19/2014 07:49 PM, Nathaniel McCallum wrote:
>>>
>>>> This is an optimization from patch 0062 (rescinded) which I think is
>>>> worth keeping. There is no ticket for this.
>>>>
>>>>
>>>> _______________________________________________
>>>> Freeipa-devel mailing list
>>>> Freeipa-devel at redhat.com
>>>> https://www.redhat.com/mailman/listinfo/freeipa-devel
>>> Hello,
>>>
>>>          That is exact that slapi* are doing a intensive usage of the
>>>          of alloc/free. Using a stack allocated mods would reduce the
>>>          number of alloc/free but I afraid it will not have a
>>>          significant impact. For example further slapi_modify_internal
>>>          is doing tons of alloc/free.
>>>                   Also I think it is not possible to use stack allocated mods.
>>>          In fact mods will be modified by internal_mod (for example to
>>>          add 'modifytimestamp', 'modifiersname') and mods will be
>>>          reallocated. This could also occurs from plugins.
>>>          Finally  if a modify retry occurs, the original mods are
>>>          freeed.
>> See ldap/servers/slapd/task.c. In this file, everything is stack
>> allocated except for the value itself.
>>
> Hi Nathaniel,
> 
>    Yes you are correct. This is even a common method :-[
>    In fact the mods are duplicated/replaced by normalized one at the
>    begining of modify_internal_pb.
>    This is that duplicated ones that can later be extended/freed.
> 
>    Sorry for the noise. The fix is valid. Ack.
> 
>    thanks
>    thierry

Pushed to:
master: 35ec0f7e3d9832c9b687bb01561a10e0304dfa74
ipa-4-1: ada187f66f3e51467aaf9bd21f74198b73805c3e

Martin




More information about the Freeipa-devel mailing list