Re: [patch 6/8] mm: memcg: remove unneeded checks from uncharge_page()

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

 



On Wed, 23 Nov 2011 16:42:29 +0100
Johannes Weiner <hannes@xxxxxxxxxxx> wrote:

> From: Johannes Weiner <jweiner@xxxxxxxxxx>
> 
> mem_cgroup_uncharge_page() is only called on either freshly allocated
> pages without page->mapping or on rmapped PageAnon() pages.  There is
> no need to check for a page->mapping that is not an anon_vma.
> 
> Signed-off-by: Johannes Weiner <jweiner@xxxxxxxxxx>

For making our assumption clearer to readers of codes,
VM_BUG_ON(page->mapping && !PageAnon(page)) please.

Anyway,
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>


> ---
>  mm/memcontrol.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 0d10be4..b9a3b94 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2989,8 +2989,6 @@ void mem_cgroup_uncharge_page(struct page *page)
>  	/* early check. */
>  	if (page_mapped(page))
>  		return;
> -	if (page->mapping && !PageAnon(page))
> -		return;
>  	__mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_MAPPED);
>  }
>  
> -- 
> 1.7.6.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


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