看板 FB_hackers 關於我們 聯絡資訊
--huq684BweRXVnRxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 08, 2008 at 10:02:03AM -0700, LI Xin wrote: > Aryeh M. Friedman wrote: > >Is it possible via sysctl or some other method to allow non-superusers= =20 > >to set any priority they want. The specific question is I often want= =20 > >to set idprio 31 on stuff but don't want to switch to root to do it (I= =20 > >am the only user on the machine). >=20 > No if nobody implement PRIV_SCHED_SETPRIORTY support for non-root. It's intentionally disabled to prevent deadlocks, see about line 330 of /usr/src/sys/kern/kern_resource.c: * Realtime priority has to be restricted for reasons which should be * obvious. However, for idle priority, there is a potential for * system deadlock if an idleprio process gains a lock on a resource * that other processes need (and the idleprio process can't run * due to a CPU-bound normal process). Fix me! XXX If you want to allow it (we've done so for years without any real trouble), simply change it to like: #if 1 if (RTP_PRIO_IS_REALTIME(rtp.type)) #else if (rtp.type !=3D RTP_PRIO_NORMAL) #endif { Marc --huq684BweRXVnRxX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFH/hpTezjnobFOgrERAmL3AKClVIu5/D6zIPvup75SswF6I1zprwCeOsIY WTURwp8SgrKAUeFXFGbBvos= =KOza -----END PGP SIGNATURE----- --huq684BweRXVnRxX--