* Why page fault handler behaved this way? Please help! @ 2014-10-30 7:10 秦弋戈 2014-11-04 12:41 ` Mulyadi Santosa 0 siblings, 1 reply; 3+ messages in thread From: 秦弋戈 @ 2014-10-30 7:10 UTC (permalink / raw) To: kernelnewbies; +Cc: linux-mm [-- Attachment #1: Type: text/plain, Size: 1122 bytes --] Dear all, I am a kernel newbie who want's to learn more about memory management. Recently I'm doing some experiment on page fault handler. There happened something that I couldn't understand. From reading the book Understanding the Linux Kernel, I know that the kernel loads a page as late as possible. It's only happened when the program has to reference (read, write, or execute) a page yet the page is not in memory. 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. 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. So why are there only 2 page faults in code segment? It shouldn't be like this in my opinion. Please help me. The attachment is my kernel log. Limited by the mail size, I couldn't upload my program, but I believe that the log is clear enough. Thank you very much. Best regards [-- Attachment #2: kernel_log --] [-- Type: application/octet-stream, Size: 20723 bytes --] Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725730] Mapping result of ./rxpm Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725733] mm struct =========================. Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725735] No. 0 vma ---------- Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725737] vm_start = 8048000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725739] vm_end = 806a000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725740] vm_flags = 874 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725742] No. 1 vma ---------- Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725743] vm_start = 806a000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725745] vm_end = 806c000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725746] vm_flags = 100873 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725748] No. 2 vma ---------- Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725749] vm_start = b7761000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725751] vm_end = b7763000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725752] vm_flags = 4044401 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725754] No. 3 vma ---------- Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725755] vm_start = b7763000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725756] vm_end = b7764000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725758] vm_flags = 40075 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725759] No. 4 vma ---------- Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725761] vm_start = b7764000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725762] vm_end = b7784000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725764] vm_flags = 875 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725765] No. 5 vma ---------- Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725766] vm_start = b7784000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725768] vm_end = b7786000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725769] vm_flags = 100873 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725771] No. 6 vma ---------- Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725772] vm_start = bfc11000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725774] vm_end = bfc33000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725775] vm_flags = 100173 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725777] mm struct end ====================== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725777] Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725780] A rxpm program started! pid = 2948. Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725782] filename = ./rxpm Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725785] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725787] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725788] address = b77651a0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725790] ip = b77651a0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725791] vm_flags = 875 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725793] vm_start = b7764000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725799] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725801] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725802] address = b777ce88 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725804] ip = b777ce88 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725805] vm_flags = 875 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725807] vm_start = b7764000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725811] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725813] error_code = 6 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725814] address = b7784ea0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725815] ip = b7768b99 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725817] vm_flags = 100873 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725818] vm_start = b7784000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725828] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725830] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725831] address = 8048034 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725832] ip = b7765c21 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725834] vm_flags = 874 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725835] vm_start = 8048000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725844] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725845] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725846] address = 806af0c Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725848] ip = b7765d8b Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725849] vm_flags = 100873 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725851] vm_start = 806a000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725855] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725856] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725858] address = b776301c Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725859] ip = b7765f82 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725861] vm_flags = 40075 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725862] vm_start = b7763000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725877] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725879] error_code = 6 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725880] address = b775f004 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725881] ip = b776beab Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725883] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725884] vm_start = b775f000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725889] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725891] error_code = 6 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725892] address = b7760838 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725894] ip = b777cd56 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725895] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725896] vm_start = b775f000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725901] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725902] error_code = 7 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725904] address = 806af78 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725905] ip = b77667ef Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725907] vm_flags = 100873 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725908] vm_start = 806a000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725917] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725918] error_code = 6 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725920] address = bfc30ffc Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725921] ip = b776c2c5 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725922] vm_flags = 100173 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725924] vm_start = bfc11000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725995] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725997] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.725998] address = b774a000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726000] ip = b777cab0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726001] vm_flags = 71 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726002] vm_start = b774a000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726012] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726014] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726015] address = b775bacc Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726017] ip = b7778a7a Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726018] vm_flags = 71 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726020] vm_start = b774a000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726046] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726048] error_code = 6 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726050] address = b7746edc Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726051] ip = b777cc37 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726052] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726054] vm_start = b7744000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726062] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726063] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726065] address = b7745d9c Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726066] ip = b776aa93 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726068] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726069] vm_start = b7744000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726073] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726074] error_code = 7 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726076] address = b7745dc8 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726077] ip = b776aaa8 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726079] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726080] vm_start = b7744000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726085] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726087] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726088] address = b75961b8 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726090] ip = b776e75b Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726091] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726092] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726098] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726100] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726101] address = b75a8f41 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726103] ip = b777c364 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726104] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726106] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726118] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726119] error_code = 6 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726120] address = b7595000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726122] ip = b7764c4b Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726123] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726125] vm_start = b7595000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726132] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726134] error_code = 7 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726135] address = b77441cc Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726136] ip = b776f451 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726138] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726139] vm_start = b7744000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726177] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726179] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726180] address = b7614820 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726182] ip = b7614820 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726183] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726185] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726190] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726192] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726193] address = b76c41f3 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726195] ip = b76c41f3 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726196] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726198] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726203] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726204] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726206] address = b77496c0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726207] ip = b761482c Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726208] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726210] vm_start = b7747000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726213] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726214] error_code = 7 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726215] address = b77496c4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726217] ip = b75afcdc Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726218] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726220] vm_start = b7747000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726224] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726226] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726227] address = b762f880 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726229] ip = b762f880 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726230] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726232] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726261] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726262] error_code = 6 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726264] address = b7747e24 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726265] ip = b75af7d6 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726267] vm_flags = 100073 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726268] vm_start = b7747000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726271] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726273] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726274] address = b7687d50 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726276] ip = b7687d50 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726277] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726278] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726284] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726286] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726287] address = b75bdf70 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726288] ip = b75bdf70 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726290] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726291] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726298] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726299] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726300] address = b75c81d0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726302] ip = b75c81d0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726303] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726305] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726310] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726311] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726313] address = b76fb830 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726314] ip = b762efd8 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726316] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726317] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726329] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726331] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726332] address = 805dbf0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726333] ip = 805dbf0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726335] vm_flags = 874 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726336] vm_start = 8048000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726344] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726346] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726347] address = b760a6a0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726349] ip = b760a6a0 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726350] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726351] vm_start = b7596000 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726358] Page fault in rxpm! info ======== Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726359] error_code = 4 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726361] address = b7650b14 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726362] ip = b7650b14 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726363] vm_flags = 75 Oct 29 20:25:59 Michael-HP-Compaq-6280-Pro-MT-PC kernel: [14296.726365] vm_start = b7596000 [-- Attachment #3: Type: text/plain, Size: 169 bytes --] _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why page fault handler behaved this way? Please help! 2014-10-30 7:10 Why page fault handler behaved this way? Please help! 秦弋戈 @ 2014-11-04 12:41 ` Mulyadi Santosa 2014-11-04 13:13 ` Kirill A. Shutemov 0 siblings, 1 reply; 3+ messages in thread From: Mulyadi Santosa @ 2014-11-04 12:41 UTC (permalink / raw) To: 秦弋戈; +Cc: kernelnewbies, linux-mm [-- Attachment #1: Type: text/plain, Size: 2166 bytes --] Hello... how big is your binary anyway? 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. 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. On Thu, Oct 30, 2014 at 2:10 PM, 秦弋戈 <michaelbest002@126.com> wrote: > > > > Dear all, > > > I am a kernel newbie who want's to learn more about memory management. > Recently I'm doing some experiment on page fault handler. There happened > something that I couldn't understand. > > > From reading the book Understanding the Linux Kernel, I know that the > kernel loads a page as late as possible. It's only happened when the > program has to reference (read, write, or execute) a page yet the page is > not in memory. > > > 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. > > > 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. > > > So why are there only 2 page faults in code segment? It shouldn't be like > this in my opinion. Please help me. > > > The attachment is my kernel log. Limited by the mail size, I couldn't > upload my program, but I believe that the log is clear enough. > > > Thank you very much. > Best regards > > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com [-- Attachment #2: Type: text/html, Size: 2880 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why page fault handler behaved this way? Please help! 2014-11-04 12:41 ` Mulyadi Santosa @ 2014-11-04 13:13 ` Kirill A. Shutemov 0 siblings, 0 replies; 3+ messages in thread From: Kirill A. Shutemov @ 2014-11-04 13:13 UTC (permalink / raw) To: Mulyadi Santosa; +Cc: 秦弋戈, kernelnewbies, linux-mm On Tue, Nov 04, 2014 at 07:41:08PM +0700, Mulyadi Santosa wrote: > Hello... > > how big is your binary anyway? > > 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. > > 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. > > > On Thu, Oct 30, 2014 at 2:10 PM, c?|a 1/4 ?ae?? <michaelbest002@126.com> wrote: > > > > > > > > > Dear all, > > > > > > I am a kernel newbie who want's to learn more about memory management. > > Recently I'm doing some experiment on page fault handler. There happened > > something that I couldn't understand. > > > > > > From reading the book Understanding the Linux Kernel, I know that the > > kernel loads a page as late as possible. It's only happened when the > > program has to reference (read, write, or execute) a page yet the page is > > not in memory. > > > > > > 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. > > > > > > 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. > > > > > > So why are there only 2 page faults in code segment? It shouldn't be like > > this in my opinion. Please help me. We have "faultaround" feature in recent kernel which tries to map 64k with one page fault if the pages are already in page cache. There's handle in debugfs to disable the feature, if you want to play with this. > > The attachment is my kernel log. Limited by the mail size, I couldn't > > upload my program, but I believe that the log is clear enough. > > > > > > Thank you very much. > > Best regards > > > > > > _______________________________________________ > > Kernelnewbies mailing list > > Kernelnewbies@kernelnewbies.org > > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > > > > > > -- > regards, > > Mulyadi Santosa > Freelance Linux trainer and consultant > > blog: the-hydra.blogspot.com > training: mulyaditraining.blogspot.com -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-04 13:17 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-10-30 7:10 Why page fault handler behaved this way? Please help! 秦弋戈 2014-11-04 12:41 ` Mulyadi Santosa 2014-11-04 13:13 ` Kirill A. Shutemov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).