malloc: support callbacks on memory events
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 11 Apr 2018 12:30:37 +0000 (13:30 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 11 Apr 2018 19:45:55 +0000 (21:45 +0200)
commit56efb4c117537fed58c6a7ebc7dc148464b4e8c8
tree0963ce10aaf9d0435a1141372a76014374d9dc8c
parent07dcbfe0101f8acc15c89b8fa5750d4f7d1134fe
malloc: support callbacks on memory events

Each process will have its own callbacks. Callbacks will indicate
whether it's allocation and deallocation that's happened, and will
also provide start VA address and length of allocated block.

Since memory hotplug isn't supported on FreeBSD and in legacy mem
mode, it will not be possible to register them in either.

Callbacks are called whenever something happens to the memory map of
current process, therefore at those times memory hotplug subsystem
is write-locked, which leads to deadlocks on attempt to use these
functions. Document the limitation.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
lib/librte_eal/common/eal_common_memalloc.c
lib/librte_eal/common/eal_common_memory.c
lib/librte_eal/common/eal_memalloc.h
lib/librte_eal/common/include/rte_memory.h
lib/librte_eal/rte_eal_version.map