Re: [PATCH] mm/memory: add refcount for special mapping page in copy_one_pte()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri 17-04-20 18:31:54, qiwuchen55@xxxxxxxxx wrote:
> From: chenqiwu <chenqiwu@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> ---
>  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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux