Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Apr 2008 15:46:59 +0200
From:      Marc Olzheim <zlo@zlo.nu>
To:        d@delphij.net
Cc:        freebsd-hackers@freebsd.org, "Aryeh M. Friedman" <aryeh.friedman@gmail.com>
Subject:   Re: normal users calling setpriority(2)
Message-ID:  <20080410134659.GA11204@zlo.nu>
In-Reply-To: <47FBA50B.6020801@delphij.net>
References:  <47FB8F49.6060105@gmail.com> <47FBA50B.6020801@delphij.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



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