lkml.org 
[lkml]   [2017]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v8 2/4] mm, oom: cgroup-aware OOM killer
On Wed, Sep 13, 2017 at 01:46:51PM -0700, David Rientjes wrote:
> On Mon, 11 Sep 2017, Roman Gushchin wrote:
>
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 15af3da5af02..da2b12ea4667 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -2661,6 +2661,231 @@ static inline bool memcg_has_children(struct mem_cgroup *memcg)
> > return ret;
> > }
> >
> > +static long memcg_oom_badness(struct mem_cgroup *memcg,
> > + const nodemask_t *nodemask,
> > + unsigned long totalpages)
> > +{
> > + long points = 0;
> > + int nid;
> > + pg_data_t *pgdat;
> > +
> > + /*
> > + * We don't have necessary stats for the root memcg,
> > + * so we define it's oom_score as the maximum oom_score
> > + * of the belonging tasks.
> > + */
> > + if (memcg == root_mem_cgroup) {
> > + struct css_task_iter it;
> > + struct task_struct *task;
> > + long score, max_score = 0;
> > +
> > + css_task_iter_start(&memcg->css, 0, &it);
> > + while ((task = css_task_iter_next(&it))) {
> > + score = oom_badness(task, memcg, nodemask,
> > + totalpages);
> > + if (max_score > score)
>
> score > max_score

Ups. Fixed. Thanks!

\
 
 \ /
  Last update: 2017-09-14 00:01    [W:0.143 / U:2.256 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site