Ack to merge through DRM? WAS Re: [PATCH v2 1/5] mm: Add write-protect and clean utilities for address space ranges

Thomas Hellström (VMware) thomas_os at
Mon Sep 30 17:38:31 UTC 2019

On 9/30/19 7:12 PM, Linus Torvalds wrote:
> On Mon, Sep 30, 2019 at 6:04 AM Kirill A. Shutemov <kirill at> wrote:
>> Have you seen page_vma_mapped_walk()? I made it specifically for rmap code
>> to cover cases when a THP is mapped with PTEs. To me it's not a big
>> stretch to make it cover multiple pages too.
> I agree that is closer, but it does make for calling that big complex
> function for every iteration step.
> Of course, you are right that the callback approach is problematic
> too, now that we have retpoline issues, making those very expensive.
> But at least that hopefully gets fixed some day and gets to be a rare
> problem.
> Matter ot taste, I guess.
>                Linus

Matthew Wilcox suggested something similar before the pagewalk.c rewrite:

Still, In this case I'd opt for using the pagewalk code: In the dirty 
helpers we don't ever use a struct page, but only deal with PTE entries, 
same as the pagewalk code does, but not page_vma_mapped_walk(). The 
underlying memory may well be IO memory.


More information about the dri-devel mailing list