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

Reply via email to