public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.2 keventd fix
@ 2001-11-20  0:16 Andreas Bombe
  0 siblings, 0 replies; only message in thread
From: Andreas Bombe @ 2001-11-20  0:16 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

In the 2.2 version of keventd flush_scheduled_tasks() always oopses.  It
adds a tq_struct with NULL routine to kick keventd to life which is
skipped by 2.4 run_task_queue() but the 2.2 one tries to execute it.

The following patch fixes that, I also added some spin locking from the
2.4 version which seems to be added after the backport.  (patch against
2.2.20)


--- linux-2.2.orig/kernel/context.c	Sun May 27 03:21:32 2001
+++ linux-2.2/kernel/context.c	Mon Nov 19 04:04:37 2001
@@ -101,8 +101,10 @@
 		if (signal_pending(curtask)) {
 			while (waitpid(-1, (unsigned int *)0, __WALL|WNOHANG) > 0)
 				;
+			spin_lock_irq(&curtask->sigmask_lock);
 			flush_signals(curtask);
 			recalc_sigpending(curtask);
+			spin_unlock_irq(&curtask->sigmask_lock);
 		}
 	}
 }
@@ -119,7 +121,8 @@
  * The caller should hold no spinlocks and should hold no semaphores which could
  * cause the scheduled tasks to block.
  */
-static struct tq_struct dummy_task;
+static void dummy_routine(void *whatever) {}
+static struct tq_struct dummy_task = { routine: dummy_routine };
 
 void flush_scheduled_tasks(void)
 {


-- 
Andreas Bombe <bombe@informatik.tu-muenchen.de>    DSA key 0x04880A44

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-11-20  0:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-20  0:16 [PATCH] 2.2 keventd fix Andreas Bombe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox