Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1356005

Re: [PATCH] mm: memcontrol: zap task_struct->memcg_oom_{gfp_mask,order}

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: memcontrol: zap task_struct->memcg_oom_{gfp_mask,order}
Date 2016-03-11 16:50 +0100
Message-ID <rbxub-8i6-45@gated-at.bofh.it> (permalink)
References (2 earlier) <rbuwi-6jM-9@gated-at.bofh.it> <rbuPD-6r7-5@gated-at.bofh.it> <rbvC3-70o-33@gated-at.bofh.it> <rbwop-7y9-1@gated-at.bofh.it> <rbwRs-7YD-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri 11-03-16 18:02:24, Vladimir Davydov wrote:
> On Fri, Mar 11, 2016 at 03:30:31PM +0100, Michal Hocko wrote:
[...]
> > Not really. GFP_KERNEL would allow to invoke some shrinkers which are
> > GFP_NOFS incopatible.
> 
> Can't a GFP_NOFS allocation happen when there is no shrinkable objects
> to drop so that there's no real difference between GFP_KERNEL and
> GFP_NOFS?

Yes it can and we do not handle that case even in the global case.
 
[...]
> > > We could ratelimit these messages. Slab charge failures are already
> > > reported to dmesg (see ___slab_alloc -> slab_out_of_memory) and nobody's
> > > complained so far. Are there any non-slab GFP_NOFS allocations charged
> > > to memcg?
> > 
> > I believe there might be some coming from FS via add_to_page_cache_lru.
> > Especially when their mapping gfp_mask clears __GFP_FS. I haven't
> > checked the code deeper but some of those might be called from the page
> > fault path and trigger memcg OOM. I would have to look closer.
> 
> If you think this warning is really a must have, and you don't like to
> warn about every charge failure, may be we could just print info about
> allocation that triggered OOM right in mem_cgroup_oom, like the code
> below does? I think it would be more-or-less equivalent to what we have
> now except it wouldn't require storing gfp_mask on task_struct.
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index a217b1374c32..d8e130d14f5d 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1604,6 +1604,8 @@ static void mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order)
>  	 */
>  	css_get(&memcg->css);
>  	current->memcg_in_oom = memcg;
> +
> +	pr_warn("Process ... triggered OOM in memcg ... gfp ...\n");

Hmm, that could lead to intermixed oom reports and matching the failure
to the particular report would be slighltly harder. But I guess it would
be acceptable if it can help to shrink the task_struct in the end. There
are people (google at least) who rely on the oom reports so I would
asked them if they are OK with that. I do not see any obvious issues
with this.

>  }
>  
>  /**

-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm: memcontrol: zap task_struct->memcg_oom_{gfp_mask,order} Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-03-11 11:20 +0100
  Re: [PATCH] mm: memcontrol: zap  task_struct->memcg_oom_{gfp_mask,order} Michal Hocko <mhocko@kernel.org> - 2016-03-11 13:00 +0100
    Re: [PATCH] mm: memcontrol: zap  task_struct->memcg_oom_{gfp_mask,order} Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-03-11 13:40 +0100
      Re: [PATCH] mm: memcontrol: zap  task_struct->memcg_oom_{gfp_mask,order} Michal Hocko <mhocko@kernel.org> - 2016-03-11 14:00 +0100
        Re: [PATCH] mm: memcontrol: zap  task_struct->memcg_oom_{gfp_mask,order} Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-03-11 14:50 +0100
          Re: [PATCH] mm: memcontrol: zap  task_struct->memcg_oom_{gfp_mask,order} Michal Hocko <mhocko@kernel.org> - 2016-03-11 15:40 +0100
            Re: [PATCH] mm: memcontrol: zap  task_struct->memcg_oom_{gfp_mask,order} Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-03-11 16:10 +0100
              Re: [PATCH] mm: memcontrol: zap  task_struct->memcg_oom_{gfp_mask,order} Michal Hocko <mhocko@kernel.org> - 2016-03-11 16:50 +0100
                Re: [PATCH] mm: memcontrol: zap  task_struct->memcg_oom_{gfp_mask,order} Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-03-11 17:00 +0100

csiph-web