On 15.07.22 17:05, Alex Sierra wrote: > From: Alistair Popple <apopple@xxxxxxxxxx> > > Currently any attempts to pin a device coherent page will fail. This is > because device coherent pages need to be managed by a device driver, and > pinning them would prevent a driver from migrating them off the device. > > However this is no reason to fail pinning of these pages. These are > coherent and accessible from the CPU so can be migrated just like > pinning ZONE_MOVABLE pages. So instead of failing all attempts to pin > them first try migrating them out of ZONE_DEVICE. > > [hch: rebased to the split device memory checks, > moved migrate_device_page to migrate_device.c] > > Signed-off-by: Alistair Popple <apopple@xxxxxxxxxx> > Acked-by: Felix Kuehling <Felix.Kuehling@xxxxxxx> > Signed-off-by: Christoph Hellwig <hch@xxxxxx> [...] > /* > * Try to move out any movable page before pinning the range. > */ > @@ -1919,7 +1948,8 @@ static long check_and_migrate_movable_pages(unsigned long nr_pages, > folio_nr_pages(folio)); > } > > - if (!list_empty(&movable_page_list) || isolation_error_count) > + if (!list_empty(&movable_page_list) || isolation_error_count > + || coherent_pages) The common style is to a) add the || to the end of the previous line b) indent such the we have a nice-to-read alignment if (!list_empty(&movable_page_list) || isolation_error_count || coherent_pages) Apart from that lgtm. Reviewed-by: David Hildenbrand <david@xxxxxxxxxx> -- Thanks, David / dhildenb