mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 2/2] PF_DEAD: kill it
Date: Fri, 25 Nov 2005 19:17:33 +0300	[thread overview]
Message-ID: <4387391D.9DDAA718@tv-sign.ru> (raw)
In-Reply-To: <20051125052337.GC22230@elte.hu>

Ingo Molnar wrote:
>
> > Perhaps it makes sense to add new TASK_DEAD flag to use it instead of
> > EXIT_DEAD, while the latter should live only in ->exit_state.
>
> yes, i'd suggest a followup patch to keep the two flag spaces totally
> disjunct - at least for testing in -mm. This area of code (when it was

Here it is.

I am also resending these 2 cleanups with EXIT_STATE changed to TASK_STATE.

Andrew, please take these new ones unless you or Ingo have any objections.

Oleg.


--- 2.6.15-rc2/include/linux/sched.h~3_RENAME	2005-11-25 21:54:07.000000000 +0300
+++ 2.6.15-rc2/include/linux/sched.h	2005-11-25 21:56:36.000000000 +0300
@@ -127,6 +127,7 @@ extern unsigned long nr_iowait(void);
 #define EXIT_DEAD		32
 /* in tsk->state again */
 #define TASK_NONINTERACTIVE	64
+#define TASK_DEAD		128
 
 #define __set_task_state(tsk, state_value)		\
 	do { (tsk)->state = (state_value); } while (0)
--- 2.6.15-rc2/kernel/exit.c~3_RENAME	2005-11-25 21:54:07.000000000 +0300
+++ 2.6.15-rc2/kernel/exit.c	2005-11-25 21:56:36.000000000 +0300
@@ -871,9 +871,9 @@ fastcall NORET_TYPE void do_exit(long co
 	tsk->mempolicy = NULL;
 #endif
 
-	/* ->state == EXIT_DEAD causes final put_task_struct after we schedule. */
+	/* ->state == TASK_DEAD causes final put_task_struct after we schedule. */
 	preempt_disable();
-	tsk->state = EXIT_DEAD;
+	tsk->state = TASK_DEAD;
 
 	schedule();
 	BUG();
--- 2.6.15-rc2/kernel/sched.c~3_RENAME	2005-11-25 21:54:07.000000000 +0300
+++ 2.6.15-rc2/kernel/sched.c	2005-11-25 21:56:36.000000000 +0300
@@ -1630,7 +1630,7 @@ static inline void finish_task_switch(ru
 	 * be dropped twice.
 	 *		Manfred Spraul <manfred@colorfullife.com>
 	 */
-	task_dead = (prev->state == EXIT_DEAD);
+	task_dead = (prev->state == TASK_DEAD);
 	finish_arch_switch(prev);
 	finish_lock_switch(rq, prev);
 	if (mm)
@@ -4711,7 +4711,7 @@ static void migrate_dead(unsigned int de
 	BUG_ON(tsk->exit_state != EXIT_ZOMBIE && tsk->exit_state != EXIT_DEAD);
 
 	/* Cannot have done final schedule yet: would have vanished. */
-	BUG_ON(tsk->state == EXIT_DEAD);
+	BUG_ON(tsk->state == TASK_DEAD);
 
 	get_task_struct(tsk);
 
--- 2.6.15-rc2/mm/oom_kill.c~3_RENAME	2005-11-25 21:54:07.000000000 +0300
+++ 2.6.15-rc2/mm/oom_kill.c	2005-11-25 21:56:36.000000000 +0300
@@ -163,7 +163,7 @@ static struct task_struct * select_bad_p
 		 */
 		releasing = test_tsk_thread_flag(p, TIF_MEMDIE) ||
 						p->flags & PF_EXITING;
-		if (releasing && (p->state != EXIT_DEAD))
+		if (releasing && (p->state != TASK_DEAD))
 			return ERR_PTR(-1UL);
 		if (p->flags & PF_SWAPOFF)
 			return p;

      reply	other threads:[~2005-11-25 15:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-24 16:02 Oleg Nesterov
2005-11-25  5:23 ` Ingo Molnar
2005-11-25 16:17   ` Oleg Nesterov [this message]

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=4387391D.9DDAA718@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 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®