NetBSD Problem Report #36594

From hf@spg.tu-darmstadt.de  Mon Jul  2 15:02:08 2007
Return-Path: <hf@spg.tu-darmstadt.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 8115263B882
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  2 Jul 2007 15:02:08 +0000 (UTC)
Message-Id: <200707021355.l62DtQCG004958@Gstoder.nt.e-technik.tu-darmstadt.de>
Date: Mon, 2 Jul 2007 15:55:26 +0200 (CEST)
From: Hauke Fath <hf@spg.tu-darmstadt.de>
Reply-To: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@NetBSD.org
Cc: Hauke Fath <hf@spg.tu-darmstadt.de>
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 <hf@spg.tu-darmstadt.de>
>Release:        NetBSD 4.0_BETA2
>Organization:
-- 
/~\  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
>Environment:


System: NetBSD Gstoder.nt.e-technik.tu-darmstadt.de 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
>Description:

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:
http://groups.google.com/group/fa.netbsd.tech.kern/browse_thread/thread/bbfc45c23bf64556/e0df78502cba2413

http://mail-index.netbsd.org/tech-kern/2004/07/29/0005.html

| > 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.


>How-To-Repeat:

	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.

>Fix:

	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.

>Release-Note:

>Audit-Trail:

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


>Unformatted:

NetBSD Home
NetBSD PR Database Search

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