Dear Bill,<br><br>Thank you for spending your valuable time for understanding and answering my queries !!!<br><br>I was trying to apply some garbage collection algorithm on this dumped pages,thats why i want only the written pages.<br>
<br>
Sorry to ask,but is there any other good way to find the written pages of a user process?<br><br>
--<br>Thanks<br>Dhyan<br><br><div class="gmail_quote">On Wed, Aug 1, 2012 at 7:38 AM, bill4carson <span dir="ltr"><<a href="mailto:bill4carson@gmail.com" target="_blank">bill4carson@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 class="im"><br>
<br>
On 2012年07月31日 17:20, Dhyan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thank You Bill !!!<br>
<br>
I dont know my approach is correct or not,But the actual purpose was to<br>
dump only written pages of a user process using a kernel module.I have<br>
a kernel thread which will dump user process memory in specific<br>
interval.So i thought of updating this flag (L_PTE_DEBUG) from<br>
handle_pte_fault and clear from my clear thread so that i can dump only<br>
the written pages after my last dump.<br>
</blockquote>
<br></div>
Yes, you can do that, only if your accounting memory doesn't get swapped<br>
out.<br>
<br>
If I understand correctly, when writing a page, you mark corresponding<br>
linux pte entry with L_PTE_DEBUG. Then your kernel module periodically<br>
loops all linux pte table, find pte entry marked with L_PTE_DEBUG.....<br>
<br>
I don't think it's wise to do so, you have 768 1st level pgd entries<br>
for user space, followed by 256 pte entries with each pgd entry.<br>
it's much slower to find out the right one.<br>
<br>
moreover, you probably need to remap those L_PTE_DEBUG physical pages<br>
into your own current process address space. IMHO, I don't follow<br>
such idea could be feasible.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
if you have some suggestions could you please share wth me?<br>
</blockquote>
<br></div>
I understand how you plan to do this, could I ask why you need to dump<br>
the written pages?<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
--<br>
Thanks<br>
Dhyan<br>
<br>
On Tue, Jul 31, 2012 at 12:43 PM, bill4carson <<a href="mailto:bill4carson@gmail.com" target="_blank">bill4carson@gmail.com</a><br></div><div class="im">
<mailto:<a href="mailto:bill4carson@gmail.com" target="_blank">bill4carson@gmail.com</a>><u></u>> wrote:<br>
<br>
<br>
<br>
On 2012年07月30日 17:39, Dhyan wrote:<br>
<br>
Dear All,<br>
<br>
From linux(2.6.35) arm page table architecture i can see we<br>
have one<br>
hardware page table and there is corresponding Linux page table<br>
Entry<br>
(L_PTE_*).The "Linux" PTE definitions are as like below from<br></div>
arch/arm/include/asm/pgtable._<u></u>_h.<div><div class="h5"><br>
<br>
|#define L_PTE_PRESENT (1<< 0)<br>
#define L_PTE_FILE (1<< 1)<br>
#define L_PTE_YOUNG (1<< 1)<br>
#define L_PTE_BUFFERABLE(1<< 2)<br>
#define L_PTE_CACHEABLE (1<< 3)<br>
#define L_PTE_USER (1<< 4)<br>
#define L_PTE_WRITE (1<< 5)<br>
#define L_PTE_EXEC (1<< 6)<br>
#define L_PTE_DIRTY (1<< 7)<br>
#define L_PTE_COHERENT (1<< 9)<br>
#define L_PTE_SHARED (1<< 10)<br>
|<br>
<br>
So is it possible to add one more #|define L_PTE_DEBUG (1 <<<br>
11)| for my<br>
<br>
debugging purpose (basically to trap all the write to that page<br>
and set<br>
this bit when write happens and clear it off in another thread<br>
)? Or<br>
is there any limitation like we can use only L_PTE till 10th bit ?<br>
<br>
<br>
No such limitation on bit 11, so you can use define L_PTE_DEBUG (1<br>
<< 11)<br>
However I don't follow why you want to do so?<br>
<br>
<br>
So could you please help<br>
<br>
--<br>
<br>
Thanks & Regards<br>
<br>
Dhayn<br>
<br>
<br>
<br></div></div>
______________________________<u></u>___________________<br>
Kernelnewbies mailing list<br>
Kernelnewbies@kernelnewbies.__<u></u>org<br>
<mailto:<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@<u></u>kernelnewbies.org</a>><br>
<a href="http://lists.kernelnewbies." target="_blank">http://lists.kernelnewbies.</a>__<u></u>org/mailman/listinfo/__<u></u>kernelnewbies <<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.<u></u>org/mailman/listinfo/<u></u>kernelnewbies</a>><div class="im">
<br>
<br>
<br>
--<br>
Love each day!<br>
<br>
--bill<br>
<br>
<br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
Love each day!<br>
<br>
--bill<br>
</div></div></blockquote></div><br>