On 06/02/2017 04:27 AM, Ard Biesheuvel wrote: > +static struct page *vmalloc_to_pud_page(unsigned long addr, pud_t *pud) > +{ > + struct page *page = NULL; > +#ifdef CONFIG_HUGETLB_PAGE Do we really want this based on hugetlbfs? Won't this be dead code on x86? Also, don't we discourage #ifdefs in .c files? > + pte_t pte = huge_ptep_get((pte_t *)pud); > + > + if (pte_present(pte)) > + page = pud_page(*pud) + ((addr & ~PUD_MASK) >> PAGE_SHIFT); x86 has pmd/pud_page(). Seems a bit silly to open-code it here. > +#else > + VIRTUAL_BUG_ON(1); > +#endif > + return page; > +} So if somebody manages to call this function on a huge page table entry, but doesn't have hugetlbfs configured on, we kill the machine? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>