mm/memory: remove redundant pte_devmap case for copy_one_pte()
Subsystems (2)
PATCH 1/2 mm/memory: remove redundant pte_devmap case for copy_one_pte()
From: chenqiwu <[email protected]>
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/
--- mm/memory.c | 2 -- 1 file changed, 2 deletions(-)
mm/memory.c +0 -2
@@ -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:
Signature · 1 line
1.9.1
PATCH 2/2 mm/memory: put refcount of normal page in zap_pte_range()
From: chenqiwu <[email protected]>
As discussed in patch[1], there is an imbalnace of normal page refcount between copy_one_pte() and zap_pte_range(). This patch put the refcount of normal page back in zap_pte_range() to fix the imbalance.
[1] https://patchwork.kernel.org/patch/11494691/
--- mm/memory.c | 1 + 1 file changed, 1 insertion(+)
mm/memory.c +1 -0
@@ -1088,6 +1088,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, } rss[mm_counter (page)]--;page_remove_rmap (page, false); +put_page (page);if (unlikely (page_mapcount (page) <0 ))print_bad_pte (vma, addr, ptent, page);if (unlikely (__tlb_remove_page (tlb, page))) {
Signature · 1 line
1.9.1
Re: [PATCH 2/2] mm/memory: put refcount of normal page in zap_pte_range()
Quoted 6 lines · On Sun, Apr 19, 2020 at 11:30:17AM +0800, [email protected] wrote:
From: chenqiwu <[email protected]>
As discussed in patch[1], there is an imbalnace of normal page refcount between
copy_one_pte()andzap_pte_range(). This patch put the refcount of normal page back inzap_pte_range()to fix the imbalance.
I think you misunderstood the discussion. NAK. Did you test this?
Quoted 7 lines · On Sun, Apr 19, 2020 at 11:30:16AM +0800, [email protected] wrote:
From: chenqiwu <[email protected]>
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_devmapcase can be removed.
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.
Quoted 22 lines
Signed-off-by chenqiwu <[email protected]>--- mm/memory.c | 2 -- 1 file changed, 2 deletions(-)mm/memory.c +0
-2@@ -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:Signature · 1 line
1.9.1
Quoted 7 lines · Matthew Wilcox
Quoted 6 lines · On Sun, Apr 19, 2020 at 11:30:16AM +0800, [email protected] wrote:
From: chenqiwu <[email protected]>
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_devmapcase can be removed.
Quoted 8 lines
Quoted 1 line
This is a terrible changelog. What it should say is something like:
Since commit
25b2995a35b6("mm: removeMEMORY_DEVICE_PUBLICsupport"), the assignment to 'page' has been unnecessary. Remove it.Reviewed-by Matthew Wilcox (Oracle) <[email protected]>
With this changelog, feel free to tadd
Quoted 23 lines
Quoted 23 lines
Signed-off-by chenqiwu <[email protected]>--- mm/memory.c | 2 -- 1 file changed, 2 deletions(-)mm/memory.c +0
-2@@ -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:Signature · 1 line
1.9.1
Signature · 2 lines
Michal Hocko SUSE Labs