Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Sep 2001 18:03:47 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Peter Wemm <peter@wemm.org>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   Re: cvs commit: src/sys/vm vm_zeroidle.c
Message-ID:  <XFMail.010901180347.jhb@FreeBSD.org>
In-Reply-To: <20010901222151.315853807@overcee.netplex.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01-Sep-01 Peter Wemm wrote:
> John Baldwin wrote:
>> jhb         2001/09/01 13:16:30 PDT
>> 
>>   Modified files:
>>     sys/vm               vm_zeroidle.c 
>>   Log:
>>   Process priority is locked by the sched_lock, not the proc lock.
>>   
>>   Revision  Changes    Path
>>   1.5       +3 -3      src/sys/vm/vm_zeroidle.c
> 
> Then you probably want to tweak rtprio(2) as well, where this was copied
> from..

From sys/proc.h:

        struct  priority p_pri; /* (j) Process priority. */

It's right in posix4/ksched.c at least.
Hmm, I haven't gotten to kern_resource.c, the PROC_LOCK's are due to the
pfind() change and are needed for a few other things.  rtprio() is busted
though, with regards to pri_to_rtp() as well.  Btw, you could just use
PRI_MAX_IDLE for p_pri.pri_level or some such for the zeroing thread directly. 
*shrug*
 
> Or perhaps better: put sched_lock calls into rtp_to_pri() function since
> that would save all the callers of it from grabbing / releasing it
> themselves.
> (see posix4/ksched.c kern/kern_resource.c vm/vm_zeroidle.c)

The functions take a priority struct, not a proc, so in theory they could be
used on priority structs not in a process.  In that case, they wouldn't need
the lock.  I'll let the callers grab the lock for when they are
examinig/changing the priority of a live process.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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




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