lkml.org 
[lkml]   [2024]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH v2 4/6] mm/migrate_device: convert __migrate_device_pages() to folios
From
On 2/16/24 1:55 PM, Matthew Wilcox wrote:
> On Fri, Feb 16, 2024 at 01:13:18PM -0800, Sidhartha Kumar wrote:
>> Use migrate_pfn_to_folio() so we can work with folios directly in
>> __migrate_device_pages().
>
> i don't understand why this would be correct if we have multipage
> folios.
>

Alistair mentioned that he is working on order > 0 device page support so I was
under the impression that currently device pages are only order 0.

Thanks,
Sid

>> @@ -719,33 +719,29 @@ static void __migrate_device_pages(unsigned long *src_pfns,
>> migrate->pgmap_owner);
>> mmu_notifier_invalidate_range_start(&range);
>> }
>> - migrate_vma_insert_page(migrate, addr, newpage,
>> + migrate_vma_insert_page(migrate, addr, &dst->page,
>
> seems to me that a migration pfn is going to refer to a precise page.
> now you're telling it to insert the head page of the folio. isn't this
> wrong?
>
>> @@ -753,13 +749,11 @@ static void __migrate_device_pages(unsigned long *src_pfns,
>> continue;
>> }
>>
>> - if (migrate && migrate->fault_page == page)
>> - r = migrate_folio_extra(mapping, page_folio(newpage),
>> - page_folio(page),
>> - MIGRATE_SYNC_NO_COPY, 1);
>> + if (migrate && migrate->fault_page == &src->page)
>
> shouldn't this rather be "page_folio(migrate->fault_page) == src"?
> ie we're looking for two pages from the same folio, rather than the page
> being the same as the head page of the folio?
>


\
 
 \ /
  Last update: 2024-05-27 15:07    [W:0.142 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site