[lkml]   [2014]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 5/7] pid: rewrite task helper function is_global_init() avoiding task->pid
On 01/23, Richard Guy Briggs wrote:
> static inline int is_global_init(struct task_struct *tsk)
> {
> - return tsk->pid == 1;
> + return task_pid_nr(tsk) == 1;
> }

ACK, but we need to fix it.

With or without this change is_global_init() actually means

This is not what the callers actually want. Just look at
oom_unkillable_task(). Suppose that p is the sub-thread of
/sbin/init, if we kill this thread we kill the whole process.

The same of other callers. is_global_init() should return T
if this task is the part of init's thread group.


 \ /
  Last update: 2014-02-21 00:01    [W:0.160 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site