Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 2002 19:10:51 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        Matt Dillon <dillon@FreeBSD.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 13343 for review
Message-ID:  <Pine.BSF.4.21.0206231858080.44896-100000@InterJet.elischer.org>
In-Reply-To: <200206232328.g5NNS4D50800@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi MAtt.. Just made it back to the computer after a busy day doing
family stuff..
thanks for catching thost things...

I couldn't test last night after committing as my test machine
at work froze up..
and there lies an interesting story..
when I went in, theo power was apparently off on it..
so when I powered it on again, I went to the serial console, and hit CR.
IT was already UP! 'uptime' said it had been up 58 minutes!

It looks to me as if it had suspended.. very odd since I don't 
have acpi in that kernleand I disabled the loading of it.



On Sun, 23 Jun 2002, Matt Dillon wrote:

> http://people.freebsd.org/~peter/p4db/chv.cgi?CH=13343
> 
> Change 13343 by dillon@apollo on 2002/06/23 16:27:40
> 
> 	NULL-out ke_thread where appropriate when a KSE is
> 	going into the IDLE queue.
> 	
> 	Fix an inverted assertion in remrunqueue().
> 	
> 	Fix a restart label in wakeup() that was breaking Julian's
> 	sys/queue.h debugging code.
> 	
> 	Change Julian's OIKS Debugger() entry:  Add a sysctl to allow
> 	us to control whether it just printf()'s, or whether it drops
> 	into the debugger.
> 	
> 	Cross fingers and hope I've done this correctly.
> 
> Affected files ...
> 
> ... //depot/projects/kse/sys/kern/kern_switch.c#58 edit
> ... //depot/projects/kse/sys/kern/kern_synch.c#71 edit
> ... //depot/projects/kse/sys/kern/kern_thread.c#78 edit
> 
> Differences ...
> 
> ==== //depot/projects/kse/sys/kern/kern_switch.c#58 (text+ko) ====
> 
> @@ -201,6 +201,7 @@
>  		KASSERT((ke->ke_state != KES_IDLE), ("kse already idle"));
>  KASSERT((ke->ke_kgrlist.tqe_next != ke), ("linked to self!"));
>  		ke->ke_state = KES_IDLE;
> +		ke->ke_thread = NULL;
>  		TAILQ_INSERT_HEAD(&kg->kg_iq, ke, ke_kgrlist);
>  		kg->kg_idle_kses++;
>  		CTR1(KTR_RUNQ, "kse_reassign: ke%p idled", ke);
> @@ -259,7 +260,7 @@
>  	struct kse *ke;
>  
>  	mtx_assert(&sched_lock, MA_OWNED);
> -	KASSERT ((td->td_state != TDS_RUNQ),
> +	KASSERT ((td->td_state == TDS_RUNQ),
>  		("remrunqueue: Bad state on run queue"));
>  	kg = td->td_ksegrp;
>  	ke = td->td_kse;
> @@ -312,6 +313,7 @@
>  			KASSERT((ke->ke_state != KES_IDLE),
>  			    ("kse already idle"));
>  			ke->ke_state = KES_IDLE;
> +			ke->ke_thread = NULL;
>  KASSERT((TAILQ_FIRST(&kg->kg_iq) != ke), ("really bad screwup"));
>  			TAILQ_INSERT_HEAD(&kg->kg_iq, ke, ke_kgrlist);
>  			kg->kg_idle_kses++;
> 
> ==== //depot/projects/kse/sys/kern/kern_synch.c#71 (text+ko) ====
> 
> @@ -421,7 +421,6 @@
>   * flag the mutex is not entered before returning.
>   */
>  
> -
>  int
>  msleep(ident, mtx, priority, wmesg, timo)
>  	void *ident;
> @@ -719,8 +718,8 @@
>  					wakeup((caddr_t)&proc0);
>  				}
>  				/* END INLINE EXPANSION */
> -				goto restart;
>  			}
> +			goto restart;
>  		}
>  	}
>  	mtx_unlock_spin(&sched_lock);
> 
> ==== //depot/projects/kse/sys/kern/kern_thread.c#78 (text+ko) ====
> 
> @@ -70,6 +70,10 @@
>  SYSCTL_INT(_kern_threads, OID_AUTO, allocated, CTLFLAG_RD,
>  	&allocated_threads, 0, "Number of threads in zone.");
>  
> +static int oiks_debug = 1;	/* 0 disable, 1 printf, 2 enter debugger */
> +SYSCTL_INT(_kern_threads, OID_AUTO, oiks, CTLFLAG_RW,
> +	&oiks_debug, 0, "OIKS thread debug");
> +
>  #define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start))
>  
>  tdlist_head_t zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads);
> @@ -375,7 +379,11 @@
>  	TAILQ_INSERT_HEAD(&kg->kg_threads, td, td_kglist);
>  	p->p_numthreads++;
>  	kg->kg_numthreads++;
> -if (p->p_numthreads > 4) Debugger("OIKS");
> +	if (oiks_debug && p->p_numthreads > 4) {
> +		printf("OIKS %d\n", p->p_numthreads);
> +		if (oiks_debug > 1)
> +			Debugger("OIKS");
> +	}
>  	td->td_critnest = 0;
>  	td->td_kse	= NULL;
>  }
> 


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0206231858080.44896-100000>