docs/189214: mlock(2) allocation limit description inaccurate

Lawrence The Dreamer Chen beastie at tardisi.com
Fri May 2 00:10:00 UTC 2014


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


More information about the freebsd-doc mailing list