Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Apr 2006 15:14:03 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        src-committers@freebsd.org
Cc:        cvs-src@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/dev/hwpmc hwpmc_mod.c src/sys/dev/random randomdev_soft.c src/sys/kern kern_intr.c kern_poll.c kern_synch.c kern_thr.c kern_umtx.c sched_4bsd.c subr_taskqueue.c uipc_mqueue.c src/sys/vm vm_zeroidle.c
Message-ID:  <200604171514.06482.jhb@freebsd.org>
In-Reply-To: <200604171820.k3HIKcx3068404@repoman.freebsd.org>
References:  <200604171820.k3HIKcx3068404@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 17 April 2006 14:20, John Baldwin wrote:
> jhb         2006-04-17 18:20:38 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/hwpmc        hwpmc_mod.c 
>     sys/dev/random       randomdev_soft.c 
>     sys/kern             kern_intr.c kern_poll.c kern_synch.c 
>                          kern_thr.c kern_umtx.c sched_4bsd.c 
>                          subr_taskqueue.c uipc_mqueue.c 
>     sys/vm               vm_zeroidle.c 
>   Log:
>   Change msleep() and tsleep() to not alter the calling thread's priority
>   if the specified priority is zero.  This avoids a race where the calling
>   thread could read a snapshot of it's current priority, then a different
>   thread could change the first thread's priority, then the original thread
>   would call sched_prio() inside msleep() undoing the change made by the
>   second thread.  I used a priority of zero as no thread that calls msleep()
>   or tsleep() should be specifying a priority of zero anyway.
>   
>   The various places that passed 'curthread->td_priority' or some variant
>   as the priority now pass 0.

This should fix the problem where the first acpi taskq would run with
a bogus priority (the sched_prio() when creating the taskqueue seemed
to be ignored).

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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