Re: [PATCH 1/6] mm: migrate_device: convert to migrate_device_coherent_folio()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> writes:

> -	WARN_ON_ONCE(PageCompound(page));
> +	WARN_ON_ONCE(folio_test_large(folio));

Note this isn't _quite_ the same as checking PageCompound() which also
checks page->compound_head & 1, but I'm guessing that should never
happen and certainly not for ZONE_DEVICE pages which can't (yet) be
compound anyway so:

Reviewed-by: Alistair Popple <apopple@xxxxxxxxxx>

>  
> -	lock_page(page);
> -	src_pfn = migrate_pfn(page_to_pfn(page)) | MIGRATE_PFN_MIGRATE;
> +	folio_lock(folio);
> +	src_pfn = migrate_pfn(folio_pfn(folio)) | MIGRATE_PFN_MIGRATE;
>  
>  	/*
>  	 * We don't have a VMA and don't need to walk the page tables to find
> -	 * the source page. So call migrate_vma_unmap() directly to unmap the
> -	 * page as migrate_vma_setup() will fail if args.vma == NULL.
> +	 * the source folio. So call migrate_vma_unmap() directly to unmap the
> +	 * folio as migrate_vma_setup() will fail if args.vma == NULL.
>  	 */
>  	migrate_device_unmap(&src_pfn, 1, NULL);
>  	if (!(src_pfn & MIGRATE_PFN_MIGRATE))
>  		return -EBUSY;
>  
> -	dpage = alloc_page(GFP_USER | __GFP_NOWARN);
> -	if (dpage) {
> -		lock_page(dpage);
> -		dst_pfn = migrate_pfn(page_to_pfn(dpage));
> +	dfolio = folio_alloc(GFP_USER | __GFP_NOWARN, 0);
> +	if (dfolio) {
> +		folio_lock(dfolio);
> +		dst_pfn = migrate_pfn(folio_pfn(dfolio));
>  	}
>  
>  	migrate_device_pages(&src_pfn, &dst_pfn, 1);
>  	if (src_pfn & MIGRATE_PFN_MIGRATE)
> -		copy_highpage(dpage, page);
> +		folio_copy(dfolio, folio);
>  	migrate_device_finalize(&src_pfn, &dst_pfn, 1);
>  
>  	if (src_pfn & MIGRATE_PFN_MIGRATE)





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux