From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 23 16:55:00 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64DC61065670 for ; Wed, 23 Feb 2011 16:55:00 +0000 (UTC) (envelope-from drbaud@yahoo.com) Received: from nm6.bullet.mail.ne1.yahoo.com (nm6.bullet.mail.ne1.yahoo.com [98.138.90.69]) by mx1.freebsd.org (Postfix) with SMTP id 2AE0F8FC0A for ; Wed, 23 Feb 2011 16:54:59 +0000 (UTC) Received: from [98.138.90.57] by nm6.bullet.mail.ne1.yahoo.com with NNFMP; 23 Feb 2011 16:54:59 -0000 Received: from [98.138.89.234] by tm10.bullet.mail.ne1.yahoo.com with NNFMP; 23 Feb 2011 16:54:59 -0000 Received: from [127.0.0.1] by omp1049.mail.ne1.yahoo.com with NNFMP; 23 Feb 2011 16:54:59 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 543518.81854.bm@omp1049.mail.ne1.yahoo.com Received: (qmail 2668 invoked by uid 60001); 23 Feb 2011 16:54:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1298480099; bh=zVC15ZeKiF6GxRkoTUozSx3xmrfHOTBIHMfbA58097E=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=sA6pSy0bi38lSZNFo3+9KjzK2Kc/Cs/TJddcZAMIEG6qG3FlyzFEp3ZLTQFwixkYFEM9CuNNwS+snJ0+K+zH/nRjZ3QA6FziUmxkbb9hxGG2ocTR3u2FLrRNAU2jIINnZEQ8KpT6R2FupaDQm/1NEzanjuJb8ksd0S54uRbUBi0= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=ZBrHB+bN2hmT1jtFyJFGFaeQxyY1hU3a10saC1TJHEkBXrGVU01PS+aJgeCqefJ6qQH2hrtIKyJF2eWk0GAvrL3eV2PRzXTt5bCaDBq+4WAm8ZWwlSSMcpM8UCb6gfVn280eT8bOG80rl3J82b6h5k0gi9NVJ0lt1WHqjHTWx/s=; Message-ID: <365029.99890.qm@web120713.mail.ne1.yahoo.com> X-YMail-OSG: GbNlA8EVM1kRU0cbQCI4XQjHWjFB0Pqx5bilHm7xWXuhiwf EY4R4e3o6LUhrKk54sM_2YXU6H3YymWuPac4FQhbnvldm1p1vNqmcdYYLtPz j6PShWMwJKYTt_Fwx3lmG6csewMP8VTf7SrOmC57ZfofDoLDmlbXfHXrnTbp QNNlhQSHDGXlmRUg7NQA8lPG342WqdRNAVBcIUp8NDp24JCuCfbXCvGJaBA9 Xvd25Ddrd_CTDc5QynfrLrathAzp0B3EeS1D0SIC1 Received: from [64.238.244.146] by web120713.mail.ne1.yahoo.com via HTTP; Wed, 23 Feb 2011 08:54:59 PST X-Mailer: YahooMailRC/555 YahooMailWebService/0.8.109.292656 Date: Wed, 23 Feb 2011 08:54:59 -0800 (PST) From: "Dr. Baud" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1873715402-1298480099=:99890" X-Mailman-Approved-At: Wed, 23 Feb 2011 16:59:50 +0000 Subject: Re: Super pages X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2011 16:55:00 -0000 --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 bWVtX3BoeXMtbWVtX3dpcmVkKQppbmZvWzJdPSJNYXhpbXVtIHBoeXNpY2Fs IHBhZ2VzIiAgICAgICAgICAgICAgICAjIG1lbV9yZWFsCmluZm9bNF09IlZp cnVhbCBtZW1vcnkgcGFnZXMiICAgICAgICAgICAgICAgICAgICMgbWVtX3Zt X3BhZ2VzCmluZm9bNV09IkNhY2hlZDogYWxtb3N0IGF2YWlsLiB0byBhbGxv Y2F0IiAgICAgICMgbWVtX2NhY2hlCmluZm9bNl09IkluYWN0aXZlOiByZWNl bnRseSB1bnJlZmVyZW5jZWQiICAgICA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