[PATCH 01/12] mm/gup.c: Remove redundant check for PCI P2PDMA page

Alistair Popple posted 12 patches 2 months, 3 weeks ago
[PATCH 01/12] mm/gup.c: Remove redundant check for PCI P2PDMA page
Posted by Alistair Popple 2 months, 3 weeks ago
PCI P2PDMA pages are not mapped with pXX_devmap PTEs therefore the
check in __gup_device_huge() is redundant. Remove it

Signed-off-by: Alistair Popple <apopple@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: David Hildenbrand <david@redhat.com>
---
 mm/gup.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/mm/gup.c b/mm/gup.c
index d19884e..5d2fc9a 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2954,11 +2954,6 @@ static int gup_fast_devmap_leaf(unsigned long pfn, unsigned long addr,
 			break;
 		}
 
-		if (!(flags & FOLL_PCI_P2PDMA) && is_pci_p2pdma_page(page)) {
-			gup_fast_undo_dev_pagemap(nr, nr_start, flags, pages);
-			break;
-		}
-
 		folio = try_grab_folio_fast(page, 1, flags);
 		if (!folio) {
 			gup_fast_undo_dev_pagemap(nr, nr_start, flags, pages);
-- 
git-series 0.9.1
Re: [PATCH 01/12] mm/gup.c: Remove redundant check for PCI P2PDMA page
Posted by Dan Williams 2 months, 1 week ago
Alistair Popple wrote:
> PCI P2PDMA pages are not mapped with pXX_devmap PTEs therefore the
> check in __gup_device_huge() is redundant. Remove it
> 
> Signed-off-by: Alistair Popple <apopple@nvidia.com>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> Acked-by: David Hildenbrand <david@redhat.com>
> ---
>  mm/gup.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index d19884e..5d2fc9a 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -2954,11 +2954,6 @@ static int gup_fast_devmap_leaf(unsigned long pfn, unsigned long addr,
>  			break;
>  		}
>  
> -		if (!(flags & FOLL_PCI_P2PDMA) && is_pci_p2pdma_page(page)) {
> -			gup_fast_undo_dev_pagemap(nr, nr_start, flags, pages);
> -			break;
> -		}
> -

Looks good.

Reviewed-by: Dan Wiliams <dan.j.williams@intel.com>