<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i>Thanks for your reply, and I think I found the reason.<br><br>by reading the comment inside the kern_slaballocate.c , I know that the memory has been released.</i><br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i>but malloc/free are seperated into differnt modules,  memory allocated in module A is released in module B. so when I unload module A, it said "1000 bytes" not release yet, and "-1000 bytes" when I unload module B. <br><br>They are positive and negative values. So will this become a problem because A module release B module's memory? <br><br></i></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 9, 2014 at 4:51 PM, bycn82 <span dir="ltr"><<a href="mailto:bycn82@gmail.com" target="_blank">bycn82@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i>I print the pointer after kmalloc and before kfree, I noticed that all the memory has been released</i>. <br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><i>kmalloc and kfree with pointer values are appearing in pair.</i><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 9, 2014 at 4:44 PM, Sepherosa Ziehau <span dir="ltr"><<a href="mailto:sepherosa@gmail.com" target="_blank">sepherosa@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Dec 9, 2014 at 3:43 PM, bycn82 <span dir="ltr"><<a href="mailto:bycn82@gmail.com" target="_blank">bycn82@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small"><i>Hi,<br><br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i>Yesterday,I was checking the memory "alloc/free" for ipfw2 basic module, because I know that the memory is not controlling well, and I dont understand the meaning of below two line.<br><br>Dec  9 08:30:23 dfly kernel: ipfw2 module basic unloaded malloc<span style="color:rgb(0,0,0)">_uninit: 96 bytes o</span>f 'IP_FW<br>2_BASIC' still allocated on cpu 4<br>Dec  9 08:30:23 dfly kernel:<br>Dec  9 08:30:23 dfly kernel: IP firewall unloaded malloc_unin<span style="color:rgb(0,0,0)">it: -96 by</span>tes of 'IP_FW2_BASI<br>C' still allocated on cpu 4<br><br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i>size 96, so it is the dyn_rule, and I noticed that the kfree for dyn_rule was exists and it was triggered. but the message still there.<br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i><br></i></div></div></blockquote><div><br><br></div></span><div>It means you didn't free all of the allocated memory before unload the module.<br></div><span><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small"><i></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i>another thing is I met below. it is inside the kmalloc ?<br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i><br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i><br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i><img src="cid:ii_i3gy4yv00_14a2df2be027dc3b" height="258" width="472"><br><br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i><br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i><br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i><br>Regards,<br></i></div><div style="font-family:verdana,sans-serif;font-size:small"><i>Bill Yuan</i><br></div></div>
</blockquote></span></div><span><font color="#888888"><br><br clear="all"><br>-- <br><div>Tomorrow Will Never Die</div>
</font></span></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>