Date: Sat, 23 Feb 2008 03:00:11 GMT From: pluknet <pluknet@gmail.com> To: freebsd-i386@FreeBSD.org Subject: Re: i386/74327: [pmap] [patch] mlock() causes physical memory leakage Message-ID: <200802230300.m1N30BwR040068@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/74327; it has been noted by GNATS. From: pluknet <pluknet@gmail.com> To: bug-followup@freebsd.org, deniskv@mail.ru Cc: Subject: Re: i386/74327: [pmap] [patch] mlock() causes physical memory leakage Date: Sat, 23 Feb 2008 04:16:50 +0300 I tried to reproduce on RELENG_[67] mlock()'ing 20 megs - without success. Test procedure (output from RELENG_7, same from _6): [root@notebook /tmp]# for i in 1 2 3 4 5; do ./a; done 64414 69534 64414 69534 64414 69534 64414 69534 64414 69534 --- #include <sys/mman.h> #include <sys/types.h> #include <sys/sysctl.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> int main(void) { u_int count; size_t len = sizeof(u_int); const size_t size = 20 * 1024 * 1024; void *a; a = malloc(size); if (a == NULL) perror("malloc"); bzero(a, size); sysctlbyname("vm.stats.vm.v_wire_count", &count, &len, NULL, 0); printf("%d\n", count); if (mlock(a, size) == -1) perror("mlock"); sysctlbyname("vm.stats.vm.v_wire_count", &count, &len, NULL, 0); printf("%d\n", count); exit(0); } ---
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802230300.m1N30BwR040068>