Re: [PATCH 2/6] mm: migrate_device: use a folio in migrate_device_range()

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

 



Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> writes:

> Save two calls to compound_head() and use folio throughout.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>

Reviewed-by: Alistair Popple <apopple@xxxxxxxxxx>

> ---
>  mm/migrate_device.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/mm/migrate_device.c b/mm/migrate_device.c
> index 82d75205dda8..66db28b89f9b 100644
> --- a/mm/migrate_device.c
> +++ b/mm/migrate_device.c
> @@ -898,16 +898,17 @@ int migrate_device_range(unsigned long *src_pfns, unsigned long start,
>  	unsigned long i, pfn;
>  
>  	for (pfn = start, i = 0; i < npages; pfn++, i++) {
> -		struct page *page = pfn_to_page(pfn);
> +		struct folio *folio;
>  
> -		if (!get_page_unless_zero(page)) {
> +		folio = folio_get_nontail_page(pfn_to_page(pfn));
> +		if (!folio) {
>  			src_pfns[i] = 0;
>  			continue;
>  		}
>  
> -		if (!trylock_page(page)) {
> +		if (!folio_trylock(folio)) {
>  			src_pfns[i] = 0;
> -			put_page(page);
> +			folio_put(folio);
>  			continue;
>  		}





[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