> > vm.max_wired looks like a sysctl, but sysctl doesn't know about it.
> > sysctl: unknown oid 'vm.max_wired'
> 
> Yes, indeed.  I posted before looking at the diffs between RELENG_7 and
> CURRENT.  The sysctl is only present in 8.0-CURRENT:

This is 7.0-RELEASE amd64 with 2 GiB of memory.

> Can you run your first process, which successfully wires the pages, and
> then capture the output of:
> 
>     sysctl vm.stats
> 
> Finally, run the second process, even if it fails to wire the pages, and
> capture vm.stats once more.

vm.stats.vm.v_wire_count: 65381
1st mlock() succeeded
vm.stats.vm.v_wire_count: 107541

vm.stats.vm.v_wire_count: 108053
2nd mlock() succeeded
vm.stats.vm.v_wire_count: 150289



sysctl vm.stats after 1st mlock

vm.stats.misc.zero_page_count: 9
vm.stats.misc.cnt_prezero: 0
vm.stats.vm.v_kthreadpages: 0
vm.stats.vm.v_rforkpages: 0
vm.stats.vm.v_vforkpages: 61095
vm.stats.vm.v_forkpages: 500877
vm.stats.vm.v_kthreads: 53
vm.stats.vm.v_rforks: 0
vm.stats.vm.v_vforks: 1500
vm.stats.vm.v_forks: 10313
vm.stats.vm.v_interrupt_free_min: 2
vm.stats.vm.v_pageout_free_min: 34
vm.stats.vm.v_cache_max: 27346
vm.stats.vm.v_cache_min: 13673
vm.stats.vm.v_cache_count: 23845
vm.stats.vm.v_inactive_count: 333862
vm.stats.vm.v_inactive_target: 20509
vm.stats.vm.v_active_count: 38937
vm.stats.vm.v_wire_count: 107552
vm.stats.vm.v_free_count: 2082
vm.stats.vm.v_free_min: 3241
vm.stats.vm.v_free_target: 13673
vm.stats.vm.v_free_reserved: 709
vm.stats.vm.v_page_count: 506803
vm.stats.vm.v_page_size: 4096
vm.stats.vm.v_tfree: 3855063
vm.stats.vm.v_pfree: 1167842
vm.stats.vm.v_dfree: 0
vm.stats.vm.v_tcached: 36604461
vm.stats.vm.v_pdpages: 19297552
vm.stats.vm.v_pdwakeups: 1487
vm.stats.vm.v_reactivated: 12640
vm.stats.vm.v_intrans: 94
vm.stats.vm.v_vnodepgsout: 0
vm.stats.vm.v_vnodepgsin: 17321874
vm.stats.vm.v_vnodeout: 0
vm.stats.vm.v_vnodein: 1083844
vm.stats.vm.v_swappgsout: 103
vm.stats.vm.v_swappgsin: 18
vm.stats.vm.v_swapout: 82
vm.stats.vm.v_swapin: 15
vm.stats.vm.v_ozfod: 1168
vm.stats.vm.v_zfod: 1048335
vm.stats.vm.v_cow_optim: 988
vm.stats.vm.v_cow_faults: 512546
vm.stats.vm.v_vm_faults: 7379324
vm.stats.sys.v_soft: 7443350
vm.stats.sys.v_intr: 75873519
vm.stats.sys.v_syscall: 73866688
vm.stats.sys.v_trap: 7860542
vm.stats.sys.v_swtch: 38018384
vm.stats.object.bypasses: 4390
vm.stats.object.collapses: 42617


sysctl vm.stats after 2nd mlock

vm.stats.misc.zero_page_count: 0
vm.stats.misc.cnt_prezero: 0
vm.stats.vm.v_kthreadpages: 0
vm.stats.vm.v_rforkpages: 0
vm.stats.vm.v_vforkpages: 61130
vm.stats.vm.v_forkpages: 507440
vm.stats.vm.v_kthreads: 53
vm.stats.vm.v_rforks: 0
vm.stats.vm.v_vforks: 1501
vm.stats.vm.v_forks: 10425
vm.stats.vm.v_interrupt_free_min: 2
vm.stats.vm.v_pageout_free_min: 34
vm.stats.vm.v_cache_max: 27346
vm.stats.vm.v_cache_min: 13673
vm.stats.vm.v_cache_count: 19546
vm.stats.vm.v_inactive_count: 294108
vm.stats.vm.v_inactive_target: 20509
vm.stats.vm.v_active_count: 39177
vm.stats.vm.v_wire_count: 151123
vm.stats.vm.v_free_count: 2067
vm.stats.vm.v_free_min: 3241
vm.stats.vm.v_free_target: 13673
vm.stats.vm.v_free_reserved: 709
vm.stats.vm.v_page_count: 506803
vm.stats.vm.v_page_size: 4096
vm.stats.vm.v_tfree: 3866824
vm.stats.vm.v_pfree: 1173921
vm.stats.vm.v_dfree: 0
vm.stats.vm.v_tcached: 36645336
vm.stats.vm.v_pdpages: 19338429
vm.stats.vm.v_pdwakeups: 1490
vm.stats.vm.v_reactivated: 12652
vm.stats.vm.v_intrans: 94
vm.stats.vm.v_vnodepgsout: 0
vm.stats.vm.v_vnodepgsin: 17321874
vm.stats.vm.v_vnodeout: 0
vm.stats.vm.v_vnodein: 1083844
vm.stats.vm.v_swappgsout: 103
vm.stats.vm.v_swappgsin: 18
vm.stats.vm.v_swapout: 82
vm.stats.vm.v_swapin: 15
vm.stats.vm.v_ozfod: 1306
vm.stats.vm.v_zfod: 1094325
vm.stats.vm.v_cow_optim: 988
vm.stats.vm.v_cow_faults: 517672
vm.stats.vm.v_vm_faults: 7433323
vm.stats.sys.v_soft: 7447748
vm.stats.sys.v_intr: 75923001
vm.stats.sys.v_syscall: 73890104
vm.stats.sys.v_trap: 7872847
vm.stats.sys.v_swtch: 38067580
vm.stats.object.bypasses: 4408
vm.stats.object.collapses: 43060


This is LP64, so naturally gcc complained a bit.
It was faster to throw in a sizeof() printf than to wade through the header 
files.

#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <err.h>
#include <sysexits.h>
#include <stdio.h>

int main(int unused_argc, char **unused_argv)
{
        struct rlimit rl;

        printf("sizeof rl.rlim_cur = %ld\n", sizeof(rl.rlim_cur));
        printf("sizeof rl.rlim_max = %ld\n", sizeof(rl.rlim_max));


        if( -1 == getrlimit(RLIMIT_MEMLOCK, &rl) )
                err(EX_OSERR, "Cannot get limit");

        printf("memlock.current=%lu\n", rl.rlim_cur);
        printf("    memlock.max=%lu\n", rl.rlim_max);

        return EX_OK;
}


sizeof rl.rlim_cur = 8
sizeof rl.rlim_max = 8
memlock.current=9223372036854775807
    memlock.max=9223372036854775807


Insanely large numbers, that don't change after a mlock().
That can't be right.
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to