NetBSD Problem Report #36594

From  Mon Jul  2 15:02:08 2007
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 8115263B882
	for <>; Mon,  2 Jul 2007 15:02:08 +0000 (UTC)
Message-Id: <>
Date: Mon, 2 Jul 2007 15:55:26 +0200 (CEST)
From: Hauke Fath <>
Reply-To: Hauke Fath <>
Cc: Hauke Fath <>
Subject: Hard system limit makes sysutils/memtester impractical
X-Send-Pr-Version: 3.95

>Number:         36594
>Category:       pkg
>Synopsis:       Hard system limit makes sysutils/memtester impractical
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    schmonz
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 02 15:05:13 +0000 2007
>Last-Modified:  Mon Jul 02 15:13:08 +0000 2007
>Originator:     Hauke Fath <>
>Release:        NetBSD 4.0_BETA2
/~\  The ASCII Ribbon Campaign                    Hauke Fath
\ /    No HTML/RTF in email	        Institut für Nachrichtentechnik
 X     No Word docs in email	                  TU Darmstadt
/ \  Respect for open standards              Ruf +49-6151-16-3281

System: NetBSD 4.0_BETA2 NetBSD 4.0_BETA2 (SPG_PIII) #0: Fri Jun 8 14:37:43 CEST 2007 hf@Hochstuhl:/var/obj/netbsd-builds/4/i386/sys/arch/i386/compile/SPG_PIII i386
Architecture: i386
Machine: i386

sysutils/memtester is the only non-i386 memory test tool we have in
pkgsrc. Unfortunately, when you run it you will find that no matter
what shell limits you lift, it will not be able to lock more than one
third of the memory:

[hf@Gstoder] /home/hf # limit memorylocked
memorylocked 340774 kbytes
[hf@Gstoder] /home/hf # unlimit memorylocked
[hf@Gstoder] /home/hf # limit memorylocked
memorylocked unlimited
[hf@Gstoder] /home/hf # memtester 400
memtester version 4.0.7 (32-bit)
Copyright (C) 2006 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).

pagesize is 4096
pagesizemask is 0xfffffffffffff000
want 400MB (419430400 bytes)
got  400MB (419430400 bytes), trying mlock ...failed for unknown reason.
Continuing with unlocked memory; testing will be slower and less reliable.
Loop 1:
  Stuck Address       : setting   3^C
[hf@Gstoder] /home/hf #

Aunt Google comes up with this thread:

| > I think there's a system-wide limit that applies, also.  
| > Not sure how you change it.
|        uvm_pdaemon.c:  uvmexp.wiredmax = uvmexp.npages / 3;
| It doesn't look like it's dynamically adjustable, but it 
| wouldn't be too hard to add to go with the other 
| vm.*max sysctls. (uvm_meter.c)

-- but apparently

[hf@Gstoder] ~ > sysctl -A | grep "vm.*max"
vm.maxslp = 20
vm.anonmax = 90
vm.filemax = 10
vm.execmax = 8
[hf@Gstoder] ~ > uname -prs
NetBSD 4.0_BETA2 i386
[hf@Gstoder] ~ > 

a "wiredmax" field has not been added since.


	Build and install sysutils/memtester. Run it, and note that it
	comes up with a "failed mlock" error if you attempt to cover
	more than a third of the installed memory.


	While it is the OSes responsibility to provide the knob to up
	the max. wired pages limit, the package DESCR should hint at
	the problem, and a possible fix.

	Feel free to change the category to "kern" _after_ the comment
	has been added - most of the related Google hits are for
	Linux OSes, actually.



Responsible-Changed-From-To: pkg-manager->schmonz
Responsible-Changed-When: Mon, 02 Jul 2007 15:13:08 +0000
Over to maintainer.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.