linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: qiwuchen55@gmail.com
To: akpm@linux-foundation.org, mhocko@suse.com, willy@infradead.org
Cc: linux-mm@kvack.org, chenqiwu <chenqiwu@xiaomi.com>
Subject: [PATCH 2/2] mm/memory: put refcount of normal page in zap_pte_range()
Date: Sun, 19 Apr 2020 11:30:17 +0800	[thread overview]
Message-ID: <1587267017-25310-2-git-send-email-qiwuchen55@gmail.com> (raw)
In-Reply-To: <1587267017-25310-1-git-send-email-qiwuchen55@gmail.com>

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.

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

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

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))) {
-- 
1.9.1



  reply	other threads:[~2020-04-19  3:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-19  3:30 [PATCH 1/2] mm/memory: remove redundant pte_devmap case for copy_one_pte() qiwuchen55
2020-04-19  3:30 ` qiwuchen55 [this message]
2020-04-19 10:30   ` [PATCH 2/2] mm/memory: put refcount of normal page in zap_pte_range() Matthew Wilcox
2020-04-19 10:26 ` [PATCH 1/2] mm/memory: remove redundant pte_devmap case for copy_one_pte() Matthew Wilcox
2020-04-20  7:54   ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587267017-25310-2-git-send-email-qiwuchen55@gmail.com \
    --to=qiwuchen55@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chenqiwu@xiaomi.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox