mem: mark pages as not accessed when reserving VA
authorDavid Marchand <david.marchand@redhat.com>
Mon, 9 Mar 2020 14:54:42 +0000 (15:54 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 13 Mar 2020 12:53:12 +0000 (13:53 +0100)
commit8a4baf06c17a806696fb10aba36fce7471983028
tree57d20665b9a1e4b6cdaccfaee7aae44f285a728a
parent754b6166f522f3fab2c6dd7949c9d1180aa1c7a9
mem: mark pages as not accessed when reserving VA

When the memory allocator reserves virtual addresses, it still does not
know what they will be used for.
Besides, huge areas are reserved for memory hotplug in multiprocess
setups. But most of the pages are unused in the whole life of the
processes.

Change protection mode to PROT_NONE when only reserving VA.
The memory allocator already switches to the right mode when making use
of it.

It also has the nice effect of getting those pages skipped by the kernel
when calling mlockall() or when a coredump gets generated.

Cc: stable@dpdk.org
Suggested-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/common/eal_common_memory.c