All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: [2.6.34 PATCH] kernel: fix exit message for dead process
Date: Thu, 20 May 2010 14:17:40 -0400	[thread overview]
Message-ID: <10672.1274379460@localhost> (raw)
In-Reply-To: Your message of "Thu, 20 May 2010 08:55:20 EDT." <20100520085520.5176d13c.akpm@linux-foundation.org>

If a process is exiting with a non-zero preempt_count, it's in fact almost
certainly going to fail to do so because it is exiting due to a BUG or OOPS
while it held a lock, at which point it will never actually exit.  So change
the message to say it attempted to do so, rather than implying it succeeded.
Problem spotted when a process BUG'ed, the kernel reported the 'exited' status,
and then proceeded to BUG twice more dealing with the now-zombied process:

> [   35.357018] note: keymap[2481] exited with preempt_count 1
> [   35.360503] BUG: scheduling while atomic: keymap/2481/0x10000002

Yes, one line is 83 characters. It's still more readable than a split printk.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>

--- linux-2.6.34-mmotm0519/kernel/exit.c.dist	2010-05-20 10:59:11.646870592 -0400
+++ linux-2.6.34-mmotm0519/kernel/exit.c	2010-05-20 14:05:16.068800223 -0400
@@ -936,7 +936,7 @@ NORET_TYPE void do_exit(long code)
 	raw_spin_unlock_wait(&tsk->pi_lock);
 
 	if (unlikely(in_atomic()))
-		printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
+		printk(KERN_INFO "note: %s[%d] tried to exit with preempt_count %d\n",
 				current->comm, task_pid_nr(current),
 				preempt_count());
 


  parent reply	other threads:[~2010-05-20 18:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 23:13 mmotm 2010-05-19-16-12 uploaded akpm
2010-05-20 15:21 ` mmotm 2010-05-19 - Kconfig dependency list from hell Valdis.Kletnieks
2010-05-20 15:47 ` mmotm 2010-05-19 BUG weirdness Valdis.Kletnieks
2010-05-20 12:55   ` Andrew Morton
2010-05-20 16:45     ` Dmitry Torokhov
2010-05-20 17:52     ` Valdis.Kletnieks
2010-05-20 18:17     ` Valdis.Kletnieks [this message]
2010-05-20 18:36       ` [2.6.34 PATCH] kernel: fix exit message for dead process Andrew Morton
2010-05-20 21:08 ` [PATCH -mmotm] media: ak881x needs slab.h Randy Dunlap
2010-06-01  6:04   ` Ingo Molnar
2010-05-20 21:08 ` [PATCH -mmotm] backlight: fix s6e63m0 kconfig Randy Dunlap
2010-05-20 21:08 ` [PATCH -mmotm] backlight: fix s6e63m0 device attr function return types Randy Dunlap

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=10672.1274379460@localhost \
    --to=valdis.kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.