<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div apple-content-edited="true">
<div style="orphans: auto; text-align: start; text-indent: 0px; widows: auto;">Thank for  your help!<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">when the server boot up, it has 7989066 pages  availrmem.  after I launch one VM (8Gmemory),  availrmem decrease to 4756624 .</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0px; font-size: 11px; font-family: Menlo;">7989066-4756624 = 3232442</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">3232442/256 = 12626.7265625 / 1024 = 12.3G</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div></div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;"><br></div><div style="margin: 0px;"><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">root@BLCC01:/root# mdb -ke 'availrmem/D ; pages_pp_maximum/D'</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">availrmem:</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">availrmem:      7989066</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">pages_pp_maximum:</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">pages_pp_maximum:               325044</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">root@BLCC01:/root# </span></font>qemu-system-x86_64 -enable-kvm -vnc 0.0.0.0:12 -cpu host -smp 4 -m 8192 -no-hpe</div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">root@BLCC01:/root# mdb -ke 'availrmem/D ; pages_pp_maximum/D'</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">availrmem:</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">availrmem:      4756624</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">pages_pp_maximum:</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">pages_pp_maximum:               325044</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">root@BLCC01:/root#</span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;">That mean the VM  use 12.3G </span></font>availrmem , how it happens ?</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">Thank !</div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div style="margin: 0px;"><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">------------------------------</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">fcliang</div></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br><div><div>On Dec 2, 2015, at 1:37, Joshua M. Clulow <<a href="mailto:josh@sysmgr.org">josh@sysmgr.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On 1 December 2015 at 09:11, Dan McDonald <<a href="mailto:danmcd@omniti.com">danmcd@omniti.com</a>> wrote:<br><blockquote type="cite"><blockquote type="cite">On Dec 1, 2015, at 12:03 PM, Fucai.Liang <<a href="mailto:fcliang@baolict.com">fcliang@baolict.com</a>> wrote:<br>then I start the third vm (4G memory), it got the following error :<br>qemu-system-x86_64 -enable-kvm -vnc 0.0.0.0:2 -cpu host -smp 2 -m 4096 -no-hpet<br><br>qemu_mlock: have only locked 1940582400 of 4294967296 bytes; still trying...<br>qemu_mlock: have only locked 1940582400 of 4294967296 bytes; still trying...<br>qemu_mlock: have only locked 1940582400 of 4294967296 bytes; still trying...<br>qemu_mlock: have only locked 1940582400 of 4294967296 bytes; still trying...<br>qemu_mlock: have only locked 1940582400 of 4294967296 bytes; still trying...<br>qemu_mlock: have only locked 1940582400 of 4294967296 bytes; still trying…<br><br>I got 15G free memory in the system, why qemu-system-x86_64 can not locked enough memory ?<br></blockquote>What does "vmstat 1 5" say prior to your launch of the third VM?<br></blockquote><br>I suspect it will show you have free memory available, but that what<br>is really happening is getting here:<br><br>  <a href="https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/vm/seg_vn.c#L7989-L8002">https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/vm/seg_vn.c#L7989-L8002</a><br><br>This is likely failing in page_pp_lock() because "availrmem" has<br>fallen below "pages_pp_maximum":<br><br>  <a href="https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/vm/vm_page.c#L3817-L3818">https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/vm/vm_page.c#L3817-L3818</a><br><br>We set this value here, though it can be overridden in "/etc/system":<br><br>  <a href="https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/vm/vm_page.c#L423-L436">https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/vm/vm_page.c#L423-L436</a><br><br>You can look at the current values with mdb:<br><br>  mdb -ke 'availrmem/D ; pages_pp_maximum/D'<br><br>Increasing this value doesn't seem to be without risk: I believe that<br>it can lead to memory exhaustion deadlocks, amongst other things.  I<br>don't know if it's expected to be tuneable without a reboot.<br><br><br>Cheers.<br><br>-- <br>Joshua M. Clulow<br>UNIX Admin/Developer<br><a href="http://blog.sysmgr.org">http://blog.sysmgr.org</a><br></blockquote></div><br></body></html>