<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i>thanks for replying, </i></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i><br></i></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i>I noticed that it was because module A released the memory which allocated in module B. thought they are using the same m_type in kmalloc/kfree.</i></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i><br></i></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i>below are the message,</i></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i><br></i></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><div class="gmail_default"><i>Dec  9 19:05:21 dfly kernel: ipfw2 module basic unloaded malloc_uninit: 96 bytes of 'IPFW2_BASIC' still allocated on cpu 4  <font color="#ff0000">---------this line is printed when ipfw_basic modules was unloaded,  96 bytes still on the system</font></i></div><div class="gmail_default"><i>Dec  9 19:05:21 dfly kernel: IP firewall unloaded malloc_uninit: -96 bytes of 'IPFW2_BASIC' still allocated on cpu 4  <font color="#ff0000">----and this line is printed when ipfw modules was unloaded, now it is -96 bytes</font></i></div><div class="gmail_default"><i><br></i></div><div class="gmail_default"><i>I am going to move the code from ipfw module to ipfw_basic module, so the 96 bytes are going to allocate/free within the same module.</i></div><div class="gmail_default"><i><br></i></div><div class="gmail_default"><i>Regards,</i></div><div class="gmail_default"><i>Bycn82</i></div><div class="gmail_default"><i><br></i></div><div class="gmail_default"><i><br></i></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 4:45 AM, Matthew Dillon <span dir="ltr"><<a href="mailto:dillon@apollo.backplane.com" target="_blank">dillon@apollo.backplane.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">    Memory must be allocated and freed from the same pool.  It is not<br>
    legal to allocate memory from one pool and free it to another.<br>
<br>
    These memory pools are struct malloc_type and typically denoted with<br>
    M_SOMENAME in device and network drivers.<br>
<br>
                                                -Matt<br>
</blockquote></div><br></div>