All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@osdl.org>,
	roland@redhat.com, torvalds@osdl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] use pid_alive in proc_pid_status
Date: Mon, 29 Nov 2004 18:58:30 +0100	[thread overview]
Message-ID: <41AB6346.2080601@colorfullife.com> (raw)
In-Reply-To: <20041129094152.GB7868@elte.hu>

Ingo Molnar wrote:

>* Andrew Morton <akpm@osdl.org> wrote:
>
>  
>
>>> +int pid_alive(struct task_struct *p)
>>> +{
>>> +	return p->pids[PIDTYPE_PID].nr != 0;
>>> +}
>>>      
>>>
>>Can we not simply test p->exit_state?  That's already done in quite a
>>few places and making things consistent would be nice.
>>    
>>
>
>as long as it's accessed from under the tasklist_lock, it ought to be
>fine to check for p->exit_state != EXIT_DEAD and dereference
>p->group_leader afterwards.
>
>  
>
The tricky part is proc_pid_unhash()/proc_pid_flush(): Right now 
removing a pid from the pid bitmap and disabling /proc/<pid>/* is 
atomic: Both operations are done under tasklist_lock.
I think it would be better to modify pid_alive to p->exit_state and 
disable /proc/<pid>/* access when the exit state is set to DEAD, but 
that that would be a larger change. Probably unhash and flush could be 
merged into one function.
But I don't understand the lines in wait_task_zombie that reset 
exit_state from DEAD to ZOMBIE, so perhaps I overlook something.

--
    Manfred

  reply	other threads:[~2004-11-29 17:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-28 11:24 [PATCH] use pid_alive in proc_pid_status Manfred Spraul
2004-11-28 23:20 ` Linus Torvalds
2004-11-29  6:21 ` Andrew Morton
2004-11-29  9:41   ` Ingo Molnar
2004-11-29 17:58     ` Manfred Spraul [this message]
2004-12-03  1:04       ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41AB6346.2080601@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.