From: Michal Hocko <mhocko@kernel.org>
To: qiwuchen55@gmail.com
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
chenqiwu <chenqiwu@xiaomi.com>
Subject: Re: [PATCH] mm/memory: add refcount for special mapping page in copy_one_pte()
Date: Fri, 17 Apr 2020 13:43:12 +0200 [thread overview]
Message-ID: <20200417114312.GM26707@dhcp22.suse.cz> (raw)
In-Reply-To: <1587119514-29679-1-git-send-email-qiwuchen55@gmail.com>
On Fri 17-04-20 18:31:54, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
>
> If we get a special mapping page like device mapping page or zero page
> when copy_one_pte, it's necessary add the page refcount count.
From the changelog it is not clear what is the actual problem and how
the patch address it. Please be more verbose.
> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
> ---
> mm/memory.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index f703fe8..a57975a 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -802,8 +802,9 @@ 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)) {
> + } else if (pte_devmap(pte) || is_zero_pfn(pte_pfn(pte))) {
> page = pte_page(pte);
> + get_page(page);
> }
>
> out_set_pte:
> --
> 1.9.1
>
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2020-04-17 11:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-17 10:31 qiwuchen55
2020-04-17 11:43 ` Michal Hocko [this message]
2020-04-17 14:26 ` chenqiwu
2020-04-17 14:45 ` Matthew Wilcox
2020-04-17 15:23 ` Michal Hocko
2020-04-18 3:12 ` chenqiwu
2020-04-20 7:42 ` 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=20200417114312.GM26707@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=chenqiwu@xiaomi.com \
--cc=linux-mm@kvack.org \
--cc=qiwuchen55@gmail.com \
/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