Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

limit on locked memory

11 views
Skip to first unread message

Manuel Bouyer

unread,
Jul 29, 2004, 12:43:16 PM7/29/04
to tech...@netbsd.org
Hi,
I'm trying to run memtest (pkgsrc/sysutils/memtester) on a box with
1GB RAM (i386, if that matters). memtest locks the memory it will work on,
but it seems that it's not possible to have more than about 332MB ram locked.
memtest will find out how much memory it can lock:
Allocated 352321536 bytes...trying mlock...failed: insufficient resources.
Allocated 351272960 bytes...trying mlock...failed: insufficient resources.
Allocated 350224384 bytes...trying mlock...failed: insufficient resources.
Allocated 349175808 bytes...trying mlock...failed: insufficient resources.
Allocated 348127232 bytes...trying mlock...success. Starting tests...

starting a second instance of memtest it can lock a very small amout of
ram:
Allocated 950272 bytes...trying mlock...failed: insufficient resources.
Allocated 933888 bytes...trying mlock...failed: insufficient resources.
Allocated 917504 bytes...trying mlock...failed: insufficient resources.
Allocated 901120 bytes...trying mlock...failed: insufficient resources.
Allocated 884736 bytes...trying mlock...success. Starting tests...

A third instance can't lock anything:
Allocated 6144 bytes...trying mlock...failed: insufficient resources.
Allocated 5120 bytes...trying mlock...failed: insufficient resources.
Allocated 4096 bytes...trying mlock...failed: insufficient resources.
Allocated 3072 bytes...trying mlock...failed to align to pagesize of 4096 bytes.
Failed to get sufficient memory. Exiting...


of course I raised all limits to the max, memorylocked and memoryuse are
unlimited, datasize is at 1GB.
Any idea of what is the limiting factor and if it's easy to raise ?
With this limit, I can only test 1/3 of the available RAM ...

--
Manuel Bouyer <bou...@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--

Jason Thorpe

unread,
Jul 29, 2004, 2:21:49 PM7/29/04
to Manuel Bouyer, tech...@netbsd.org

On Jul 29, 2004, at 9:42 AM, Manuel Bouyer wrote:

> of course I raised all limits to the max, memorylocked and memoryuse
> are
> unlimited, datasize is at 1GB.
> Any idea of what is the limiting factor and if it's easy to raise ?
> With this limit, I can only test 1/3 of the available RAM ...

I think there's a system-wide limit that applies, also. Not sure how
you change it.

-- Jason R. Thorpe <tho...@wasabisystems.com>

PGP.sig

Eric Haszlakiewicz

unread,
Jul 29, 2004, 2:47:49 PM7/29/04
to Jason Thorpe, Manuel Bouyer, tech...@netbsd.org
On Thu, Jul 29, 2004 at 11:20:34AM -0700, Jason Thorpe wrote:
> On Jul 29, 2004, at 9:42 AM, Manuel Bouyer wrote:
>
> >of course I raised all limits to the max, memorylocked and memoryuse
> >are
> >unlimited, datasize is at 1GB.
> >Any idea of what is the limiting factor and if it's easy to raise ?
> >With this limit, I can only test 1/3 of the available RAM ...
>
> 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)

eric

Manuel Bouyer

unread,
Jul 29, 2004, 3:48:40 PM7/29/04
to Eric Haszlakiewicz, Jason Thorpe, tech...@netbsd.org
On Thu, Jul 29, 2004 at 01:32:02PM -0500, Eric Haszlakiewicz wrote:
> 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)

Yes ! changed this to
uvmexp.wiredmax = uvmexp.npages - 32768, and now:
Memory: 12M Act, 872M Wired, 3712K Exec, 3184K File, 89M Free
Swap: 1201M Total, 1201M Free

PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
229 root 64 0 128M 129M RUN/0 2:39 29.98% 29.98% memtest
628 root 64 0 128M 129M RUN/0 2:35 29.30% 29.30% memtest
524 root 64 0 128M 129M RUN/1 2:36 29.00% 29.00% memtest
227 root 64 0 128M 129M RUN/1 2:36 28.56% 28.56% memtest
331 root 64 0 128M 129M CPU/1 2:26 26.86% 26.86% memtest
694 root 64 0 128M 129M RUN/0 2:29 26.76% 26.76% memtest
533 root 64 0 105M 106M RUN/0 2:31 25.73% 25.73% memtest


(I could probably run a single memtest with 872M, but I also want to exercise
the data path to both CPUs :)

thanks !

0 new messages