On 08/15, David Rientjes wrote: > > On Sun, 15 Aug 2010, Oleg Nesterov wrote: > > > Again, I do not know how the code looks without the patch, but > > Why not? This series is based on Linus' tree. OK, thanks... > > > + do_each_thread(g, q) { > > > + if (q->mm == mm && !same_thread_group(q, p)) > > > + force_sig(SIGKILL, q); > > > + } while_each_thread(g, q); > > > > We can kill the wrong task. "q->mm == mm" doesn't necessarily mean > > we found the task which shares ->mm with p (see above). > > > > This needs atomic_inc(mm_users). And please do not use do_each_thread. > > Instead of using mm_users to pin the mm, we could simply do this iteration > with for_each_process() before sending the SIGKILL to p. Yes, this should work too. (I'd prefer to not take ->siglock under task->alloc_lock, but currently this is correct and happens anyway). Oleg. -- 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>