pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
pgtable_gfp_flags(mm, GFP_KERNEL)); if (unlikely(!pgd)) return pgd;
/* * Don't scan the PGD for pointers, it contains references to PUDs but * those references are not full pointers and so can't be recognised by * kmemleak.
*/
kmemleak_no_scan(pgd);
/* * With hugetlb, we don't clear the second half of the page table. * If we share the same slab cache with the pmd or pud level table, * we need to make sure we zero out the full table on alloc. * With 4K we don't store slot in the second half. Hence we don't * need to do this for 4k.
*/ #ifdefined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_PPC_64K_PAGES) && \
(H_PGD_INDEX_SIZE == H_PUD_CACHE_INDEX)
memset(pgd, 0, PGD_TABLE_SIZE); #endif return pgd;
}
pud = kmem_cache_alloc(PGT_CACHE(PUD_CACHE_INDEX),
pgtable_gfp_flags(mm, GFP_KERNEL)); /* * Tell kmemleak to ignore the PUD, that means don't scan it for * pointers and don't consider it a leak. PUDs are typically only * referred to by their PGD, but kmemleak is not able to recognise those * as pointers, leading to false leak reports.
*/
kmemleak_ignore(pud);
/* * Early pud pages allocated via memblock allocator * can't be directly freed to slab. KFENCE pages have * both reserved and slab flags set so need to be freed * kmem_cache_free.
*/ if (PageReserved(page) && !PageSlab(page))
free_reserved_page(page); else
kmem_cache_free(PGT_CACHE(PUD_CACHE_INDEX), pud);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.