linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Andrew Morton <akpm@zip.com.au>, <linux-kernel@vger.kernel.org>
Subject: [patch] exit-fix-2.5.38-F0
Date: Thu, 26 Sep 2002 15:20:08 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0209261518430.17662-100000@localhost.localdomain> (raw)


i've attached a patch i got from Andrew - he found a couple of places
where we would enable interrupts while write-holding the tasklist_lock ...  
nasty.

against BK-curr, works as expected.

	Ingo

--- linux/kernel/sched.c.orig	Thu Sep 26 12:48:42 2002
+++ linux/kernel/sched.c	Thu Sep 26 13:00:39 2002
@@ -477,13 +477,15 @@
  */
 void sched_exit(task_t * p)
 {
-	local_irq_disable();
+	unsigned long flags;
+
+	local_irq_save(flags);
 	if (p->first_time_slice) {
 		p->parent->time_slice += p->time_slice;
 		if (unlikely(p->parent->time_slice > MAX_TIMESLICE))
 			p->parent->time_slice = MAX_TIMESLICE;
 	}
-	local_irq_enable();
+	local_irq_restore(flags);
 	/*
 	 * If the child was a (relative-) CPU hog then decrease
 	 * the sleep_avg of the parent as well.
--- linux/kernel/signal.c.orig	Thu Sep 26 12:48:42 2002
+++ linux/kernel/signal.c	Thu Sep 26 13:00:39 2002
@@ -1086,6 +1086,7 @@
  */
 static inline void wake_up_parent(struct task_struct *p)
 {
+	unsigned long flags;
 	struct task_struct *parent = p->parent, *tsk = parent;
 
 	/*
@@ -1095,14 +1096,14 @@
 		wake_up_interruptible(&tsk->wait_chldexit);
 		return;
 	}
-	spin_lock_irq(&parent->sig->siglock);
+	spin_lock_irqsave(&parent->sig->siglock, flags);
 	do {
 		wake_up_interruptible(&tsk->wait_chldexit);
 		tsk = next_thread(tsk);
 		if (tsk->sig != parent->sig)
 			BUG();
 	} while (tsk != parent);
-	spin_unlock_irq(&parent->sig->siglock);
+	spin_unlock_irqrestore(&parent->sig->siglock, flags);
 }
 
 /*


                 reply	other threads:[~2002-09-26 13:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.LNX.4.44.0209261518430.17662-100000@localhost.localdomain \
    --to=mingo@elte.hu \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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;
as well as URLs for NNTP newsgroup(s).