lkml.org 
[lkml]   [2023]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/7] mm/gup: Accelerate thp gup even for "pages != NULL"
On Tue, Jun 13, 2023 at 05:53:45PM -0400, Peter Xu wrote:
> + if (page_increm > 1)
> + WARN_ON_ONCE(
> + try_grab_folio(compound_head(page),

You don't need to call compound_head() here; try_grab_folio() works
on tail pages just fine.

> + page_increm - 1,
> + foll_flags) == NULL);
> +
> + for (j = 0; j < page_increm; j++) {
> + subpage = nth_page(page, j);
> + pages[i+j] = subpage;
> + flush_anon_page(vma, subpage, start + j * PAGE_SIZE);
> + flush_dcache_page(subpage);

You're better off calling flush_dcache_folio() right at the end.

\
 
 \ /
  Last update: 2023-06-14 16:59    [W:0.417 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site