Excerpts from Zefan Li's message of July 20, 2020 12:02 pm: >> +static int vmap_pages_range_noflush(unsigned long start, unsigned long end, >> + pgprot_t prot, struct page **pages, >> + unsigned int page_shift) >> +{ >> + if (page_shift == PAGE_SIZE) { > > Is this a typo of PAGE_SHIFT? Oh good catch, yeah that'll always be going via the one-at-a-time route and slow down the small page vmaps. Will fix. Thanks, Nick > >> + return vmap_small_pages_range_noflush(start, end, prot, pages); >> + } else { >> + unsigned long addr = start; >> + unsigned int i, nr = (end - start) >> page_shift; >> + >> + for (i = 0; i < nr; i++) { >> + int err; >> + >> + err = vmap_range_noflush(addr, >> + addr + (1UL << page_shift), >> + __pa(page_address(pages[i])), prot, >> + page_shift); >> + if (err) >> + return err; >> + >> + addr += 1UL << page_shift; >> + } >> + >> + return 0; >> + } >> +} >> + >