Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755299AbZJZIln (ORCPT ); Mon, 26 Oct 2009 04:41:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755126AbZJZIln (ORCPT ); Mon, 26 Oct 2009 04:41:43 -0400 Received: from smtprelay11.ispgateway.de ([80.67.31.34]:36016 "EHLO smtprelay11.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755116AbZJZIlm (ORCPT ); Mon, 26 Oct 2009 04:41:42 -0400 Message-ID: <4AE560C9.6070600@ladisch.de> Date: Mon, 26 Oct 2009 09:41:45 +0100 From: Clemens Ladisch User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: "Leonidas ." CC: linux-kernel Subject: Re: Process id recycling and status of tasks References: <4AE165A4.70706@ladisch.de> In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Df-Sender: linux-kernel@cl.domainfactory-kunde.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1162 Lines: 29 Leonidas . wrote: > On Fri, Oct 23, 2009 at 1:43 PM, Clemens Ladisch wrote: > > Get a reference to the task's pid (...), then later check whether > > pid_task() works. > > Was going through pid.c, what is the fundamental difference between pid_task() > and get_pid_task()? As I said, the functions with "get" in their name increase the reference count. In other words, get_pid_task(p) is implemented as get_task(pid_task(p)), so, if it succeeded, you would then own a reference to the task. > Now my understanding is get_pid_task() should be followed by put_pid_task() > so the reference counting work as expected, but put_pid_task() is not an > exported symbol? You'd have a standard task_struct, so you'd just use put_task(). And if you don't actually want a reference to the task (because you only want to check whether the task still exists), just use pid_task() instead. HTH Clemens -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/