Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Nov 2012 16:48:38 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Andrey Zonov <zont@FreeBSD.org>
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: unprivileged mlock(2)
Message-ID:  <5093DD46.1040701@FreeBSD.org>
In-Reply-To: <5093D771.5040606@FreeBSD.org>
References:  <5093D771.5040606@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig22C2777229BA3776F749C7E8
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

on 02/11/2012 16:23 Andrey Zonov said the following:
> Hi,
>=20
> I'm ready to commit these four patches [1].  I'm going to do this
> tomorrow if there won't be any objections.
>=20
> I want to make clear changes in login.conf about memorylocked limits.
> When the system is starting up, init(8) uses daemon login class to run
> /etc/rc.  Some daemons such as amd(8) and watchdogd(8) use mlockall(2)
> and may deny that call because of limits, that is why I set memorylocke=
d
> limit to 64Mb for daemon class.
>=20
> But the problem will be still there if you are using `sudo' or `su -m'
> to restart services.  In that case your login class (and limits) would
> be applied and memorylocked limit may cause failure of mlockall(2) call=

> (like vmemoryuse limit may fail malloc(3)).
>=20
> [1] http://people.freebsd.org/~zont/patches/mlock/
>=20

I would start with memorylocked=3D64k or 128k for the default class.
I can't justify these numbers excepts that they are nice :-) and 8MB "fee=
ls" like
too much.
Anything greater than zero would already be an improvement and typical
unprivileged applications that want wired memory usually request a single=
 page.
So several pages should be enough.
Those who would need more can always bump the limit in the local config.

P.S. Not sure if it would be better to set memorylocked=3Dunlimited for t=
he daemon
class too.  I think that in the default configuration it's only super-use=
r who can
use that class.

--=20
Andriy Gapon


--------------enig22C2777229BA3776F749C7E8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQk91iAAoJEHSlLSemUf4vOJMH/jIJcR6EFSAJvpCT8l5uf/eE
g0CpmcRy5lbXFxUYFTviHH15S4yj2yG4B22Dn3kbaMm4tTHNbfia5Rbg8nBmopJ6
MvBHd8l/nYa2hC/JowvwjeZz8BwsNjkYkR6B1RzHcxC5GFcP9M99Ax8KbVSc2Z8z
TNzJVgZWQQvC0n8/HrRpR+6PZY6XEn9gUFQFCJNJu9A5WQsTIiDqqopX/skpxgzv
Z3ipe4dtLTTnsBjmgeJSuxWeRQDVWJG4dF0vvR2ZlYtzmJz67OYL8RSPypeZAC4S
sJ373nx7+3/Ekt6tVGTYXXGwpWqvphIsLaQXtk3FprCy/75RTi4c4bdfbbTkThc=
=LphE
-----END PGP SIGNATURE-----

--------------enig22C2777229BA3776F749C7E8--



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