Re: [patch -mm 02/18] oom: sacrifice child with highest badness score for parent

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

 



On Tue, 8 Jun 2010, KOSAKI Motohiro wrote:

> > @@ -447,19 +450,27 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
> >  		return 0;
> >  	}
> >  
> > -	printk(KERN_ERR "%s: kill process %d (%s) score %li or a child\n",
> > -					message, task_pid_nr(p), p->comm, points);
> > +	pr_err("%s: Kill process %d (%s) with score %lu or sacrifice child\n",
> > +		message, task_pid_nr(p), p->comm, points);
> >  
> > -	/* Try to kill a child first */
> > +	do_posix_clock_monotonic_gettime(&uptime);
> > +	/* Try to sacrifice the worst child first */
> >  	list_for_each_entry(c, &p->children, sibling) {
> > +		unsigned long cpoints;
> > +
> >  		if (c->mm == p->mm)
> >  			continue;
> >  		if (mem && !task_in_mem_cgroup(c, mem))
> >  			continue;
> > -		if (!oom_kill_task(c))
> > -			return 0;
> > +
> 
> need to the check of cpuset (and memplicy) memory intersection here, probably.
> otherwise, this may selected innocence task.
> 

I'll do this, then, if you don't want to post your own patch.  Fine.

> also, OOM_DISABL check is necessary?
> 

No, badness() is 0 for tasks that are OOM_DISABLE.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
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]