diff mbox series

[RFC,01/10] mm/gup.c: Remove redundant check for PCI P2PDMA page

Message ID ffd72e934eeae28639b636e1e61a9c5109808420.1712796818.git-series.apopple@nvidia.com
State New
Headers show
Series fs/dax: Fix FS DAX page reference counts | expand

Commit Message

Alistair Popple April 11, 2024, 12:57 a.m. UTC
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>
---
 mm/gup.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Jason Gunthorpe April 11, 2024, 12:59 p.m. UTC | #1
On Thu, Apr 11, 2024 at 10:57:22AM +1000, 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>
> ---
>  mm/gup.c | 5 -----
>  1 file changed, 5 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason
David Hildenbrand April 11, 2024, 1:47 p.m. UTC | #2
On 11.04.24 02:57, 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>
> ---
>   mm/gup.c | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index 2f8a2d8..a9c8a09 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -2683,11 +2683,6 @@ static int __gup_device_huge(unsigned long pfn, unsigned long addr,
>   			break;
>   		}
>   
> -		if (!(flags & FOLL_PCI_P2PDMA) && is_pci_p2pdma_page(page)) {
> -			undo_dev_pagemap(nr, nr_start, flags, pages);
> -			break;
> -		}
> -
>   		SetPageReferenced(page);
>   		pages[*nr] = page;
>   		if (unlikely(try_grab_page(page, flags))) {

Rebasing on mm-unstable, you'll notice some minor conflicts, but nothing 
earth shattering :)

Acked-by: David Hildenbrand <david@redhat.com>
Alistair Popple April 12, 2024, 1:37 a.m. UTC | #3
David Hildenbrand <david@redhat.com> writes:

> On 11.04.24 02:57, 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>
>> ---
>>   mm/gup.c | 5 -----
>>   1 file changed, 5 deletions(-)
>> diff --git a/mm/gup.c b/mm/gup.c
>> index 2f8a2d8..a9c8a09 100644
>> --- a/mm/gup.c
>> +++ b/mm/gup.c
>> @@ -2683,11 +2683,6 @@ static int __gup_device_huge(unsigned long pfn, unsigned long addr,
>>   			break;
>>   		}
>>   -		if (!(flags & FOLL_PCI_P2PDMA) &&
>> is_pci_p2pdma_page(page)) {
>> -			undo_dev_pagemap(nr, nr_start, flags, pages);
>> -			break;
>> -		}
>> -
>>   		SetPageReferenced(page);
>>   		pages[*nr] = page;
>>   		if (unlikely(try_grab_page(page, flags))) {
>
> Rebasing on mm-unstable, you'll notice some minor conflicts, but
> nothing earth shattering :)

Thanks. Rebasing was the other thing I meant to add as a TODO in the
cover letter :)

> Acked-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/gup.c b/mm/gup.c
index 2f8a2d8..a9c8a09 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2683,11 +2683,6 @@  static int __gup_device_huge(unsigned long pfn, unsigned long addr,
 			break;
 		}
 
-		if (!(flags & FOLL_PCI_P2PDMA) && is_pci_p2pdma_page(page)) {
-			undo_dev_pagemap(nr, nr_start, flags, pages);
-			break;
-		}
-
 		SetPageReferenced(page);
 		pages[*nr] = page;
 		if (unlikely(try_grab_page(page, flags))) {