Re: [patch -mm 01/18] oom: filter tasks not sharing the same cpuset

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

 



> > > >   (3) oom_kill_task (when oom_kill_allocating_task==1 only)
> > > > 
> > > 
> > > Why would care about cpuset attachment in oom_kill_task()?  You mean 
> > > oom_kill_process() to filter the children list?
> > 
> > Ah, intersting question. OK, we have to discuss oom_kill_allocating_task
> > design at first.
> > 
> > First of All, oom_kill_process() to filter the children list and this issue
> > are independent and unrelated. My patch was not correct too.
> > 
> > Now, oom_kill_allocating_task basic logic is here. It mean, if oom_kill_process()
> > return 0, oom kill finished successfully. but if oom_kill_process() return 1,
> > fallback to normall __out_of_memory().
> > 
> 
> Right.
> 
> > 
> > 	===================================================
> > 	static void __out_of_memory(gfp_t gfp_mask, int order, nodemask_t *nodemask)
> > 	{
> > 	        struct task_struct *p;
> > 	        unsigned long points;
> > 	
> > 	        if (sysctl_oom_kill_allocating_task)
> > 	                if (!oom_kill_process(current, gfp_mask, order, 0, NULL, nodemask,
> > 	                                      "Out of memory (oom_kill_allocating_task)"))
> > 	                        return;
> > 	retry:
> > 
> > When oom_kill_process() return 1?
> > I think It should be
> > 	- current is OOM_DISABLE
> 
> In this case, oom_kill_task() returns 1, which causes oom_kill_process() 
> to return 1 if current (and not one of its children) is actually selected 
> to die.

Right.

> 
> > 	- current have no intersected CPUSET
> 
> current will always intersect its own cpuset's mems.

Oops, It was my mistake.


> 
> > 	- current is KTHREAD
> 
> find_lock_task_mm() should take care of that in oom_kill_task() just like 
> it does for OOM_DISABLE, although we can still race with use_mm(), in 
> which case this would be a good chance.

find_lock_task_mm() implementation is here. it only check ->mm.
other place are using both KTHREAD check and find_lock_task_mm().

----------------------------------------------------------------------
/*
 * The process p may have detached its own ->mm while exiting or through
 * use_mm(), but one or more of its subthreads may still have a valid
 * pointer.  Return p, or any of its subthreads with a valid ->mm, with
 * task_lock() held.
 */
static struct task_struct *find_lock_task_mm(struct task_struct *p)
{
        struct task_struct *t = p;

        do {
                task_lock(t);
                if (likely(t->mm))
                        return t;
                task_unlock(t);
        } while_each_thread(p, t);

        return NULL;
}

--
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]