Re: RFC: Proposal: Add NUMA Memory Policy Tunable to glibc malloc implementation

罗春生 luochunsheng@ustc.edu
Tue Aug 5 06:42:58 GMT 2025


To Florian:

>> The original proposal addressed a specific timing challenge: critical
>> allocations occurring during the initialization sequence: ld.so
>> initialization → early malloc calls → first user call to
>> set_mempolicy()

> If the parent process calls set_mempolicy, the policy gets applied to
> these earlier allocations, too.  

If the parent process calls set_mempolicy, the parent process will also go
through `ld.so initialization → early malloc calls → main() -> 
first call to set_mempolicy`, and these earlier allocations still will exist.

Now numactl takes advantage of the process inheritance property of mempolicy. 
It first sets the memory policy and then executes the target application through execv. 
usage : numactl [mempolicy] command args .... , In this way, early malloc behavior 
will also exist when numactl is executed. 

Thanks
Chunsheng Luo



More information about the Libc-alpha mailing list