Subject: Re: 1.5ALPHA_2 i386 panic in suspendsched()
To: Jason R Thorpe <thorpej@zembu.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 09/14/2000 21:10:03
--gKMricLos+KVdGMg
Content-Type: text/plain; charset=us-ascii

On Thu, Sep 14, 2000 at 12:01:10PM -0700, Jason R Thorpe wrote:
> On Thu, Sep 14, 2000 at 08:24:35PM +0200, Manuel Bouyer wrote:
> 
>  > it removes procs from the run queue. In -current it's guarded by
>  > SCHED_LOCK(s)/SCHED_UNLOCK(s), in 1.5 by splclock()/splx(). Is this enouth ?
> 
> The run queues are protected by SCHED_LOCK/SCHED_UNLOCK, yes.
> 
> The proc list is protected by proclist_lock.

ok, so suspendsched() traverses the proc list, but doesn't lock it.
I guess something like this is OK, for both -current and 1.5 ?

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--

--gKMricLos+KVdGMg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: kern_synch.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/kern_synch.c,v
retrieving revision 1.94
diff -u -r1.94 kern_synch.c
--- kern_synch.c	2000/09/05 16:27:52	1.94
+++ kern_synch.c	2000/09/14 19:08:56
@@ -1006,6 +1006,7 @@
 	int s, i;
 	struct proc *p, *next;
 	SCHED_LOCK(s);
+	proclist_lock_read();
 
 	/*
 	 * Convert all non-P_SYSTEM SSLEEP processes to SSTOP. Curproc is
@@ -1032,5 +1033,6 @@
 	}
 	/* XXX SMP: we need to deal with processes on others CPU ! */
 
+	proclist_unlock_read();
 	SCHED_UNLOCK(s);
 }

--gKMricLos+KVdGMg--