Message ID | 1587267017-25310-2-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 |
On Sun, Apr 19, 2020 at 11:30:17AM +0800, qiwuchen55@gmail.com wrote: > From: chenqiwu <chenqiwu@xiaomi.com> > > 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. I think you misunderstood the discussion. NAK. Did you test this?
diff --git a/mm/memory.c b/mm/memory.c index 2143827..ec8de9a 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -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))) {