Hi, Oleg Adding thread_head into task_struct->signal would be the best solution imho. This way list will be properly protected by rcu_read_lock(). But you called it "really painful". I guess that's because all users of while_each_thread(g, t) must be modified with 'g' pointing to the new thread_head. And I've counted 50 usages of while_each_thread() across the kernel. Is this really that bad? Regards. On Thu, 2 May 2013 19:20:22 +0200 Oleg Nesterov <oleg@xxxxxxxxxx> wrote: > Just to let you know that this time I didn't forget about this problem ;) > > On 04/25, Oleg Nesterov wrote: > > > > On 04/25, Sergey Dyasly wrote: > > > > > > But in general case there is still a race, > > > > Yes. Every while_each_thread() in oom-kill is wrong, and I am still not > > sure what should/can we do. Will try to think more. > > And I still can't find a simple/clean solution. > > OK. I am starting to think we should probably switch to Plan B. We can add > thread_head into task_struct->signal and convert while_each_thread() into > list_for_each_rcu(). This should work, but this is really painful and I was > going to avoid this as much as possible... > > I'll try to do something once I return from vacation (May 9). Heh, See also > http://marc.info/?l=linux-kernel&m=127688978121665 and the whole thread. > > Oleg. > -- Sergey Dyasly <dserrg@xxxxxxxxx> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>