lkml.org 
[lkml]   [2012]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 08/11] mm: memcg: remove needless !mm fixup to init_mm when charging
On Thu 05-07-12 02:45:00, Johannes Weiner wrote:
> It does not matter to __mem_cgroup_try_charge() if the passed mm is
> NULL or init_mm, it will charge the root memcg in either case.
>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>

Acked-by: Michal Hocko <mhocko@suse.cz>

> ---
> mm/memcontrol.c | 5 -----
> 1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 418b47d..6fe4101 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2766,8 +2766,6 @@ int mem_cgroup_try_charge_swapin(struct mm_struct *mm,
> ret = 0;
> return ret;
> charge_cur_mm:
> - if (unlikely(!mm))
> - mm = &init_mm;
> ret = __mem_cgroup_try_charge(mm, mask, 1, memcgp, true);
> if (ret == -EINTR)
> ret = 0;
> @@ -2832,9 +2830,6 @@ int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
> if (PageCompound(page))
> return 0;
>
> - if (unlikely(!mm))
> - mm = &init_mm;
> -
> if (!PageSwapCache(page))
> ret = mem_cgroup_charge_common(page, mm, gfp_mask, type);
> else { /* page is swapcache/shmem */
> --
> 1.7.7.6
>

--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic


\
 
 \ /
  Last update: 2012-07-09 18:01    [W:0.230 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site