mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Hugh Dickins <hugh@veritas.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] -mm check_rlimit oops on p->signal
Date: Mon, 15 Nov 2004 15:43:46 -0800	[thread overview]
Message-ID: <20041115154346.33089c0b.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0411152043250.4131-100000@localhost.localdomain>

Hugh Dickins <hugh@veritas.com> wrote:
>
> +	if (likely(p->signal && p->exit_state < EXIT_ZOMBIE)) {

Worried.  This places an ordering interpretation on TASK_* and EXIT_* which
AFAIK hadn't been there beforehand.  If someone later comes along and adds

#define TASK_DOODLING 64

then we lose.

I wonder if for clarity and future-safety we should do something like:

--- 25/include/linux/sched.h~task-exit_state-clarity	Mon Nov 15 15:40:24 2004
+++ 25-akpm/include/linux/sched.h	Mon Nov 15 15:42:40 2004
@@ -105,13 +105,20 @@ extern unsigned long nr_iowait(void);
 
 #include <asm/processor.h>
 
+/*
+ * Tasks whose exit_state is less that TASK_EXIT_MARKER are considered to
+ * be still running.  Tasks whose exit_state is greater than TASK_EXIT_MARKER
+ * are in the process of exitting.  TASK_EXIT_MARKER is never actually set in
+ * task_struct.exit_state.
+ */
 #define TASK_RUNNING		0
 #define TASK_INTERRUPTIBLE	1
 #define TASK_UNINTERRUPTIBLE	2
 #define TASK_STOPPED		4
 #define TASK_TRACED		8
-#define EXIT_ZOMBIE		16
-#define EXIT_DEAD		32
+#define TASK_EXIT_MARKER	16	
+#define EXIT_ZOMBIE		32
+#define EXIT_DEAD		64
 
 #define __set_task_state(tsk, state_value)		\
 	do { (tsk)->state = (state_value); } while (0)
_

It seems a bit dorky for some reason...

  reply	other threads:[~2004-11-15 23:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-15 20:45 Hugh Dickins
2004-11-15 23:43 ` Andrew Morton [this message]
2004-11-16  0:07   ` Hugh Dickins

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=20041115154346.33089c0b.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®