From owner-freebsd-arch@FreeBSD.ORG Fri Nov 2 14:49:10 2012 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B256550; Fri, 2 Nov 2012 14:49:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2EBB58FC18; Fri, 2 Nov 2012 14:49:08 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA03816; Fri, 02 Nov 2012 16:49:07 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <5093DD46.1040701@FreeBSD.org> Date: Fri, 02 Nov 2012 16:48:38 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andrey Zonov Subject: Re: unprivileged mlock(2) References: <5093D771.5040606@FreeBSD.org> In-Reply-To: <5093D771.5040606@FreeBSD.org> X-Enigmail-Version: 1.4.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig22C2777229BA3776F749C7E8" Cc: freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 14:49:10 -0000 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--