diff mbox series

[1/2] mm/memory: remove redundant pte_devmap case for copy_one_pte()

Message ID 1587267017-25310-1-git-send-email-qiwuchen55@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/2] mm/memory: remove redundant pte_devmap case for copy_one_pte() | expand

Commit Message

chenqiwu April 19, 2020, 3:30 a.m. UTC
From: chenqiwu <chenqiwu@xiaomi.com>

As discussed in patch[1], special mapping ptes such as device
mapping ptes don't need to operate on their corresponding pages,
so the redundant pte_devmap case can be removed.

[1] https://patchwork.kernel.org/patch/11494691/

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 mm/memory.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Matthew Wilcox April 19, 2020, 10:26 a.m. UTC | #1
On Sun, Apr 19, 2020 at 11:30:16AM +0800, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> As discussed in patch[1], special mapping ptes such as device
> mapping ptes don't need to operate on their corresponding pages,
> so the redundant pte_devmap case can be removed.
> 
> [1] https://patchwork.kernel.org/patch/11494691/

This is a terrible changelog.  What it should say is something like:

Since commit 25b2995a35b6 ("mm: remove MEMORY_DEVICE_PUBLIC support"),
the assignment to 'page' has been unnecessary.  Remove it.

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
> ---
>  mm/memory.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index f703fe8..2143827 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -802,8 +802,6 @@ struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr,
>  		get_page(page);
>  		page_dup_rmap(page, false);
>  		rss[mm_counter(page)]++;
> -	} else if (pte_devmap(pte)) {
> -		page = pte_page(pte);
>  	}
>  
>  out_set_pte:
> -- 
> 1.9.1
> 
>
Michal Hocko April 20, 2020, 7:54 a.m. UTC | #2
On Sun 19-04-20 03:26:13, Matthew Wilcox wrote:
> On Sun, Apr 19, 2020 at 11:30:16AM +0800, qiwuchen55@gmail.com wrote:
> > From: chenqiwu <chenqiwu@xiaomi.com>
> > 
> > As discussed in patch[1], special mapping ptes such as device
> > mapping ptes don't need to operate on their corresponding pages,
> > so the redundant pte_devmap case can be removed.
> > 
> > [1] https://patchwork.kernel.org/patch/11494691/
> 
> This is a terrible changelog.  What it should say is something like:
> 
> Since commit 25b2995a35b6 ("mm: remove MEMORY_DEVICE_PUBLIC support"),
> the assignment to 'page' has been unnecessary.  Remove it.
> 
> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

With this changelog, feel free to tadd
Acked-by: Michal Hocko <mhocko@suse.com>

> 
> > Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
> > ---
> >  mm/memory.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/mm/memory.c b/mm/memory.c
> > index f703fe8..2143827 100644
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -802,8 +802,6 @@ struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr,
> >  		get_page(page);
> >  		page_dup_rmap(page, false);
> >  		rss[mm_counter(page)]++;
> > -	} else if (pte_devmap(pte)) {
> > -		page = pte_page(pte);
> >  	}
> >  
> >  out_set_pte:
> > -- 
> > 1.9.1
> > 
> >
diff mbox series

Patch

diff --git a/mm/memory.c b/mm/memory.c
index f703fe8..2143827 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -802,8 +802,6 @@  struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr,
 		get_page(page);
 		page_dup_rmap(page, false);
 		rss[mm_counter(page)]++;
-	} else if (pte_devmap(pte)) {
-		page = pte_page(pte);
 	}
 
 out_set_pte: