From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid Date: Tue, 17 Dec 2013 10:34:42 +0100 Message-ID: <20131217093442.GE21999@twins.programming.kicks-ass.net> References: <20130822190848.GA25053@redhat.com> <20130826220711.GA21098@madcap2.tricolour.ca> <20131216173547.GA21582@madcap2.tricolour.ca> <20131216210558.GA8565@redhat.com> <20131216222051.GA21056@madcap2.tricolour.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20131216222051.GA21056@madcap2.tricolour.ca> Sender: linux-kernel-owner@vger.kernel.org To: Richard Guy Briggs Cc: Oleg Nesterov , Eric Paris , linux-kernel@vger.kernel.org, linux-audit@redhat.com, Andrew Morton , "Eric W. Biederman" , "Serge E. Hallyn" List-Id: linux-audit@redhat.com On Mon, Dec 16, 2013 at 05:20:51PM -0500, Richard Guy Briggs wrote: > static inline bool is_idle_task(const struct task_struct *p) > { > - return p->pid == 0; > + return task_pid(p) == &init_struct_pid; > } > I'll stick with task_pid_nr(p) == 0. We're going to probably switch to: return p->flags & PF_IDLE; Soon, because people are playing silly tricks and want normal threads to temporarily appear to be the idle thread (idle time injection).