[SLOF] [PATCH v2 07/11] libnet: Wire up pxelinux.cfg network booting

Thomas Huth thuth at redhat.com
Fri May 25 16:16:33 AEST 2018


On 25.05.2018 08:10, Greg Kurz wrote:
> On Fri, 25 May 2018 07:42:53 +0200
> Thomas Huth <thuth at redhat.com> wrote:
> 
>> On 25.05.2018 07:27, Alexey Kardashevskiy wrote:
>>> On 25/5/18 2:42 pm, Thomas Huth wrote:  
[...]
>>>> By the way, something for our TODO lists: We really should add some
>>>> logic to the libc free() function to merge freed memory blocks again if
>>>> possible...  
>>>
>>> Do you have any measurements of how much loose on this?  
>>
>> No. Since we scarcely used malloc and free in the SLOF code in the past,
>> this also was never an issue. But if we now add more and more code that
>> uses malloc + free, we should keep this in mind and be prepared to face
>> out-of-memory problems one day due to the memory fragmentation here.
>>
> 
> It looks like some memory defragmentation logic already exists but it is
> only used during malloc() when the heap is full. Isn't this enough ?

Oh, you're right. I only looked at the free() code and did not notice
the clean() function in the malloc.c code. I didn't expect that...
Intuitively, I'd rather implement that during free() instead. But during
malloc() should be ok, too, so never mind, fragmentation is then likely
not such a big issue as I originally thought.

 Thomas


More information about the SLOF mailing list