From owner-freebsd-doc@FreeBSD.ORG Fri May 2 00:10:00 2014 Return-Path: Delivered-To: freebsd-doc@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2713D1A for ; Fri, 2 May 2014 00:10:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 999B51C94 for ; Fri, 2 May 2014 00:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s420A0CJ000481 for ; Fri, 2 May 2014 00:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s420A0IM000480; Fri, 2 May 2014 00:10:00 GMT (envelope-from gnats) Resent-Date: Fri, 2 May 2014 00:10:00 GMT Resent-Message-Id: <201405020010.s420A0IM000480@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Lawrence "The Dreamer" Chen Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BBFDCB7 for ; Fri, 2 May 2014 00:02:01 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BE131C5C for ; Fri, 2 May 2014 00:02:00 +0000 (UTC) Received: from ip70-179-144-228.fv.ks.cox.net ([70.179.144.228] helo=zen.lhaven.homeip.net) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Wg0vQ-000PaJ-3x for FreeBSD-gnats-submit@freebsd.org; Fri, 02 May 2014 00:02:00 +0000 Received: from zen.lhaven.homeip.net (localhost [127.0.0.1]) by zen.lhaven.homeip.net (8.14.8/8.14.7) with ESMTP id s4200hfh081257; Thu, 1 May 2014 19:00:53 -0500 (CDT) (envelope-from lchen@zen.lhaven.homeip.net) Received: (from lchen@localhost) by zen.lhaven.homeip.net (8.14.8/8.14.7/Submit) id s4200NU6081077; Thu, 1 May 2014 19:00:23 -0500 (CDT) (envelope-from lchen) Message-Id: <201405020000.s4200NU6081077@zen.lhaven.homeip.net> Date: Thu, 1 May 2014 19:00:23 -0500 (CDT) From: Lawrence "The Dreamer" Chen To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: docs/189214: mlock(2) allocation limit description inaccurate X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Lawrence The Dreamer Chen List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 00:10:00 -0000 >Number: 189214 >Category: docs >Synopsis: mlock(2) allocation limit description inaccurate >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Fri May 02 00:10:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Lawrence "The Dreamer" Chen >Release: FreeBSD 9.2-RELEASE-p5 amd64 >Organization: >Environment: System: FreeBSD zen.lhaven.homeip.net 9.2-RELEASE-p5 FreeBSD 9.2-RELEASE-p5 #0: Tue Apr 29 19:09:13 UTC 2014 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 >Description: In mlock(2), it says: Since physical memory is a potentially scarce resource, processes are limited in how much they can lock down. A single process can mlock() the minimum of a system-wide ``wired pages'' limit vm.max_wired and the per-process RLIMIT_MEMLOCK resource limit. >How-To-Repeat: >Fix: The more correct answer is like its the minimum of the per-process RLIMIT_MEMLOCK resource limt, and the difference of the system-wide ''wired pages'' limit vm.max_wired and the total count of wired pages on the system vm.stat.vm.v_wire_count. Been trying to figure out why gnome-keyring-daemon can't lock any memory even though I have set "security.bsd.unprivileged_mlock=1" and RLIMIT_MEMLOCK default to 64 (kilobytes.) vm.max_wired on my system defaults to 1323555 (pages - pagesize is 4k.) Well, turns out vm.stat.vm.v_wire_count was 2020311.... >Release-Note: >Audit-Trail: >Unformatted: