From owner-cvs-all Sat Sep 1 18: 4:19 2001 Delivered-To: cvs-all@freebsd.org Received: from mail.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by hub.freebsd.org (Postfix) with ESMTP id A432337B40D for ; Sat, 1 Sep 2001 18:03:46 -0700 (PDT) Received: (qmail 72993 invoked from network); 2 Sep 2001 01:03:42 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 2 Sep 2001 01:03:42 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010901222151.315853807@overcee.netplex.com.au> Date: Sat, 01 Sep 2001 18:03:47 -0700 (PDT) From: John Baldwin To: Peter Wemm Subject: Re: cvs commit: src/sys/vm vm_zeroidle.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 -- 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