[dpdk-dev] [PATCH 4/6] mem: use address hint for mapping hugepages
Burakov, Anatoly
anatoly.burakov at intel.com
Tue Jul 3 12:46:51 CEST 2018
On 03-Jul-18 11:44 AM, Alejandro Lucero wrote:
>
> + addr = mmap(addr_hint,
> (*size) + hugepage_sz, PROT_READ,
> #ifdef RTE_ARCH_PPC_64
> MAP_PRIVATE | MAP_ANONYMOUS |
> MAP_HUGETLB,
> @@ -286,8 +312,14 @@
> MAP_PRIVATE,
> #endif
> fd, 0);
> - if (addr == MAP_FAILED)
> + if (addr == MAP_FAILED) {
> + /* map failed. Let's try with less memory */
> *size -= hugepage_sz;
> + } else if (addr_hint && addr != addr_hint) {
> + /* map not using hint. Let's try with
> another offset */
>
>
> Comment is slightly misleading - "map not using hint" implies we are
> about to map something without using hint. Suggested rewording:
>
> suggested address hint was not used, try with another offset
>
>
> What about "hint was not used. Try with another offset" ?
Works for me :)
--
Thanks,
Anatoly
More information about the dev
mailing list