Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 May 1998 14:30:01 -0700 (PDT)
From:      Tor Egge <Tor.Egge@idi.ntnu.no>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/6587: SMP idle cpl breaks signal forwarding
Message-ID:  <199805112130.OAA26024@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/6587; it has been noted by GNATS.

From: Tor Egge <Tor.Egge@idi.ntnu.no>
To: will@iki.fi
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/6587: SMP idle cpl breaks signal forwarding
Date: Mon, 11 May 1998 23:27:46 +0200

 Having a shared AST flag in an SMP configuration is wrong. 
 This is one of the bad side effects.
 
 Appended is an attempt at a workaround. Consider it my submission to 
 a kludge stacking contest.
 
 - Tor Egge
 
 Index: swtch.s
 ===================================================================
 RCS file: /home/ncvs/src/sys/i386/i386/swtch.s,v
 retrieving revision 1.71
 diff -u -r1.71 swtch.s
 --- swtch.s	1998/04/06 15:44:31	1.71
 +++ swtch.s	1998/05/11 20:46:13
 @@ -49,6 +49,8 @@
  #include <machine/pmap.h>
  #include <machine/apic.h>
  #include <machine/smptests.h>		/** GRAB_LOPRIO */
 +#include <machine/ipl.h>
 +#include <machine/lock.h>
  #endif /* SMP */
  
  #include "assym.s"
 @@ -308,6 +310,10 @@
  	 *
  	 * XXX: we had damn well better be sure we had it before doing this!
  	 */
 +	CPL_LOCK
 +	andl	$~SWI_AST_MASK, _ipending 
 +	movl	$0, _cpl	/* Allow ASTs on other CPU */
 +	CPL_UNLOCK
  	movl	$FREE_LOCK, %eax
  	movl	%eax, _mp_lock
  
 @@ -357,16 +363,20 @@
  	jmp	idle_loop
  
  3:
 -#ifdef SMP
  	movl	$LOPRIO_LEVEL, lapic_tpr	/* arbitrate for INTs */
 -#endif
  	call	_get_mplock
 +	CPL_LOCK
 +	movl	$SWI_AST_MASK, _cpl	/* Disallow ASTs on other CPU */
 +	CPL_UNLOCK	
  	cmpl	$0,_whichrtqs			/* real-time queue */
  	CROSSJUMP(jne, sw1a, je)
  	cmpl	$0,_whichqs			/* normal queue */
  	CROSSJUMP(jne, nortqr, je)
  	cmpl	$0,_whichidqs			/* 'idle' queue */
  	CROSSJUMP(jne, idqr, je)
 +	CPL_LOCK
 +	movl	$0, _cpl		/* Allow ASTs on other CPU */
 +	CPL_UNLOCK
  	call	_rel_mplock
  	jmp	idle_loop
  

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805112130.OAA26024>