<div dir="ltr"><div><div><div>Hello...<br><br></div>how big is your binary anyway?<br><br></div>from your log, if my calculation is right, your code segment is around 330 KiB. But bear in mind, that not all of them are your code. There are other code like PLT, function prefix and so on.<br><br></div>Also, even if your code is big, are you sure all of them are executed? Following 20/80 principle, most of the time, when running an application, only 20% portion of the application are really used/executed during 80% of application lifetime. The rest, it might untouched at all.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 30, 2014 at 2:10 PM, 秦弋戈 <span dir="ltr">&lt;<a href="mailto:michaelbest002@126.com" target="_blank">michaelbest002@126.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
<br>
Dear all,<br>
<br>
<br>
I am a kernel newbie who want&#39;s to learn more about memory management. Recently I&#39;m doing some experiment on page fault handler. There happened something that I couldn&#39;t understand.<br>
<br>
<br>
>From reading the book Understanding the Linux Kernel, I know that the kernel loads a page as late as possible. It&#39;s only happened when the program has to reference  (read, write, or execute) a page yet the page is not in memory.<br>
<br>
<br>
However, when I traced all page faults in my test program, I found something strange. My test program is large enough, but there are only two page faults triggered in the code segment of the program, while most of the faults are not in code segment.<br>
<br>
<br>
At first I thought that perhaps the page is not the normal 4K page. Thus I turned off the PAE support in the config file. But the log remains unchanged.<br>
<br>
<br>
So why are there only 2 page faults in code segment? It shouldn&#39;t be like this in my opinion. Please help me.<br>
<br>
<br>
The attachment is my kernel log. Limited by the mail size, I couldn&#39;t upload my program, but I believe that the log is clear enough.<br>
<br>
<br>
Thank you very much.<br>
Best regards<br>
<br>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">regards,<br><br>Mulyadi Santosa<br>Freelance Linux trainer and consultant<br><br>blog: <a href="http://the-hydra.blogspot.com">the-hydra.blogspot.com</a><br>training: <a href="http://mulyaditraining.blogspot.com">mulyaditraining.blogspot.com</a></div>
</div>