Date: Wed, 23 Feb 2011 08:54:59 -0800 (PST) From: "Dr. Baud" <drbaud@yahoo.com> To: freebsd-hackers@freebsd.org Subject: Re: Super pages Message-ID: <365029.99890.qm@web120713.mail.ne1.yahoo.com>
next in thread | raw e-mail | index | archive | help
--0-1873715402-1298480099=:99890 Content-Type: text/plain; charset=us-ascii > On 23/02/2011 14:03, Dr. Baud wrote: > > > > In general, is it unadvisable to disable super pages? > > I don't think there would be any effect on the stability of operation if > you disable superpages, but generally (except in cases of CPU bugs) you > would not need to. Your system should operate a bit faster with > superpages enabled. When is the memory allocated via contigmalloc freed? I have a test kernel module that allocates memory in 8MB chucks until contigmalloc says enough (the ginormous.c/Makefile attachment). I also have a bash script that displays the interesting memory related kernel state variables (the mem attachement). When I load and unload the kernel module and display the VM pages stats I never see the wired pages nor free pages change: vm.pmap.pg_ps_enabled: 1 SYSTEM MEMORY INFORMATION: mem_phys: = 2138693632 ( 2039MB) Physical memory tunable mem_user: = 2107297792 ( 2009MB) User space memory available mem_real: = 2146893824 ( 2047MB) Maximum physical pages mem_all: = 2075402240 ( 1979MB) [100%] Virual memory pages mem_cache: = 0 ( 0MB) [ 0%] Cached: almost avail. to allocat mem_inactive:= 7360512 ( 7MB) [ 0%] Inactive: recently unreferenced mem_active: + 8765440 ( 8MB) [ 0%] Active: recently referenced mem_wire: 31395840 ( 29MB) [ 1%] Wired: disabled for paging out mem_free: + 2027589632 ( 1933MB) [ 97%] Free: fully available -------------- ------------ ----------- mem_hw: = 2147483648 ( 2048MB) Virual memory (cached, etc.) kldload /sys/modules/ginormous/ginormous.ko Ginormous module loading Ginormous contigmalloc failed(229): SYSTEM MEMORY INFORMATION: mem_phys: = 2138693632 ( 2039MB) Physical memory tunable mem_user: = 180330496 ( 171MB) User space memory available mem_real: = 2146893824 ( 2047MB) Maximum physical pages mem_all: = 2075402240 ( 1979MB) [100%] Virual memory pages mem_cache: = 22237184 ( 21MB) [ 1%] Cached: almost avail. to allocat mem_inactive:= 253952 ( 0MB) [ 0%] Inactive: recently unreferenced mem_active: + 2387968 ( 2MB) [ 0%] Active: recently referenced mem_wire: 1958363136 ( 1867MB) [ 94%] Wired: disabled for paging out mem_free: + 91795456 ( 87MB) [ 4%] Free: fully available -------------- ------------ ----------- mem_hw: = 2147483648 ( 2048MB) Virual memory (cached, etc.) kldunload ginormous Ginormous module unloading Warning: memory type GINORMOUS leaked memory on destroy (229 allocations, 1920991232 bytes leaked). SYSTEM MEMORY INFORMATION: mem_phys: = 2138693632 ( 2039MB) Physical memory tunable mem_user: = 180314112 ( 171MB) User space memory available mem_real: = 2146893824 ( 2047MB) Maximum physical pages mem_all: = 2075402240 ( 1979MB) [100%] Virual memory pages mem_cache: = 21565440 ( 20MB) [ 1%] Cached: almost avail. to allocat mem_inactive:= 413696 ( 0MB) [ 0%] Inactive: recently unreferenced mem_active: + 2842624 ( 2MB) [ 0%] Active: recently referenced mem_wire: 1958379520 ( 1867MB) [ 94%] Wired: disabled for paging out mem_free: + 91807744 ( 87MB) [ 4%] Free: fully available -------------- ------------ ----------- mem_hw: = 2147483648 ( 2048MB) Virual memory (cached, etc.) Note that this behavior occurs whether superpages are enabled or not. Anyone have and explanation? Dr. --0-1873715402-1298480099=:99890 Content-Type: text/plain; name="ginormous.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ginormous.c" I2luY2x1ZGUgPHN5cy90eXBlcy5oPgojaW5jbHVkZSA8c3lzL21vZHVsZS5o PgojaW5jbHVkZSA8c3lzL21hbGxvYy5oPgojaW5jbHVkZSA8c3lzL3N5c3Rt Lmg+ICAvKiB1cHJpbnRmICovCiNpbmNsdWRlIDxzeXMvcGFyYW0uaD4gIC8q IGRlZmluZXMgdXNlZCBpbiBrZXJuZWwuaCAqLwojaW5jbHVkZSA8c3lzL2tl cm5lbC5oPiAvKiB0eXBlcyB1c2VkIGluIG1vZHVsZSBpbml0aWFsaXphdGlv biAqLwojaW5jbHVkZSA8c3lzL2NvbmYuaD4gICAvKiBjZGV2c3cgc3RydWN0 ICovCgpNQUxMT0NfREVGSU5FKE1fR0lOT1JNT1VTLCAiR0lOT1JNT1VTIiwg Ikdpbm9ybW91cyBLZXJuZWwgTW9kdWxlIik7CgojZGVmaW5lIEJVRlNJWkUg KDgqMTAyNCoxMDI0KQojZGVmaW5lIE5NQUxMT0NTIDI0MQoKc3RhdGljIGlu dApnaW5vcm1vdXNfbG9hZGVyKHN0cnVjdCBtb2R1bGUgKm0sIGludCB3aGF0 LCB2b2lkICphcmcpCnsKICAgIGludCBlcnIgPSAwOwogICAgdm9pZCAqbWVt W05NQUxMT0NTXTsKCiAgICBzd2l0Y2ggKHdoYXQpCiAgICB7CiAgICBjYXNl IE1PRF9MT0FEOiAgICAgICAgICAgICAgICAvKiBrbGRsb2FkICovCiAgICAg ICAgewogICAgICAgIGludCBpOwoKICAgICAgICBwcmludGYoIkdpbm9ybW91 cyBtb2R1bGUgbG9hZGluZ1xuIik7CgogICAgICAgIGZvciAoaSA9IDA7IGkg PCBOTUFMTE9DUzsgaSsrKSB7CiAgICAgICAgICAgIGlmICgobWVtW2ldID0g Y29udGlnbWFsbG9jKCBCVUZTSVpFLAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgTV9HSU5PUk1PVVMsIAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAwVUwsIAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgfjBVTCwgCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQUdFX1NJWkUsCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSkgPT0gTlVM TCkgewogICAgICAgICAgICAgICAgcHJpbnRmKCJHaW5vcm1vdXMgY29udGln bWFsbG9jIGZhaWxlZCglZCk6XG4iLCBpKTsKICAgICAgICAgICAgICAgIGJy ZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIH0KICAgICAg ICBicmVhazsKCiAgICBjYXNlIE1PRF9VTkxPQUQ6CiAgICAgICAgcHJpbnRm KCJHaW5vcm1vdXMgbW9kdWxlIHVubG9hZGluZ1xuIik7CiAgICAgICAgYnJl YWs7CgogICAgZGVmYXVsdDoKICAgICAgICBlcnIgPSBFSU5WQUw7CiAgICAg ICAgYnJlYWs7CiAgICB9CiAgICByZXR1cm4oZXJyKTsKfQoKREVWX01PRFVM RShnaW5vcm1vdXMsIGdpbm9ybW91c19sb2FkZXIsIE5VTEwpOwo= --0-1873715402-1298480099=:99890 Content-Type: application/octet-stream; name=Makefile Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Makefile" LlBBVEg6ICAkey5DVVJESVJ9Ly4uLy4uL2Rldi9naW5vcm1vdXMKS01PRCAg ICA9IGdpbm9ybW91cwpTUkNTICAgID0gZ2lub3Jtb3VzLmMKCkNGTEFHUys9 IC1JJHsuQ1VSRElSfS8uLi8uLi9kZXYvZ2lub3Jtb3VzIC1nIC1XYWxsIC1X ZXJyb3IKQ0ZMQUdTKz0gLURWRVJTSU9OPVwiJChWRVJTSU9OKVwiCgpjbGVh bjoKCXJtIC1mICoubyAqLmtsZCAqLmtvCglybSAtZiBAIG1hY2hpbmUKCXJt IC1mICR7Q0xFQU5GSUxFU30KCi5pbmNsdWRlIDxic2Qua21vZC5taz4K --0-1873715402-1298480099=:99890 Content-Type: application/octet-stream; name=mem Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="mem" IyEvdXNyL2xvY2FsL2Jpbi9iYXNoCgpyZXR1cm5fdmFsPQoKKChhbWVnID0g KDEwMjQqMTAyNCkgKSkKCmluZm9bMF09IlBoeXNpY2FsIG1lbW9yeSB0dW5h YmxlIiAgICAgICAgICAgICAgICMgbWVtX3BoeXMKaW5mb1sxXT0iVXNlciBz cGFjZSBtZW1vcnkgYXZhaWxhYmxlIiAgICAgICAgICAgIyBtZW1fdXNlciAo bWVtX3Bo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KSAi JHtpbmZvWzEwXX0iCg== --0-1873715402-1298480099=:99890--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?365029.99890.qm>