<div class="gmail_quote">Dear Bill,<br><br>What i found from experimenting on arm Linux kernel is
,after every access if i clear the _PG_ACCESS bit of the pte (using
/proc/<pid>/clear_refs),the next write also will come to
kernel (handle_pte_fault).But I dont know whether my clearing action causing any bad impact
on any other system.<br><br>--<br>Thanks<br>Dhyan <br><br>On Thu, Aug 2, 2012 at 2:12 PM, 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年08月01日 12:53, Dhyan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Bill,<br>
<br>
Thank you for spending your valuable time for understanding and<br>
answering my queries !!!<br>
<br>
I was trying to apply some garbage collection algorithm on this dumped<br>
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<br>
of a user process?<br>
</blockquote>
<br></div>
Only the first wirte trigger page fault, which setup the page table by<br>
grabbing a physical page to backup virtual address page. After this,<br>
all write into that page goes like wind without any kernel interference<br>
anymore.<br>
<br></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
But my hunch tell me what you want is to track every user space write<br>
operation.<br>
<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 Wed, Aug 1, 2012 at 7:38 AM, bill4carson <<a href="mailto:bill4carson@gmail.com" target="_blank">bill4carson@gmail.com</a><br></div><div><div class="h5">
<mailto:<a href="mailto:bill4carson@gmail.com" target="_blank">bill4carson@gmail.com</a>><u></u>> wrote:<br>
<br>
<br>
<br>
On 2012年07月31日 17:20, Dhyan wrote:<br>
<br>
Thank You Bill !!!<br>
<br>
I dont know my approach is correct or not,But the actual purpose<br>
was to<br>
dump only written pages of a user process using a kernel<br>
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<br>
dump only<br>
the written pages after my last dump.<br>
<br>
<br>
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.<br>
<br>
<br>
<br>
if you have some suggestions could you please share wth me?<br>
<br>
<br>
I understand how you plan to do this, could I ask why you need to dump<br>
the written pages?<br>
<br>
<br>
--<br>
Thanks<br>
Dhyan<br>
<br>
On Tue, Jul 31, 2012 at 12:43 PM, bill4carson<br>
<<a href="mailto:bill4carson@gmail.com" target="_blank">bill4carson@gmail.com</a> <mailto:<a href="mailto:bill4carson@gmail.com" target="_blank">bill4carson@gmail.com</a>><br></div></div>
<mailto:<a href="mailto:bill4carson@gmail.com" target="_blank">bill4carson@gmail.com</a> <mailto:<a href="mailto:bill4carson@gmail.com" target="_blank">bill4carson@gmail.com</a>><u></u>>__><div class="im">
<br>
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<br>
see we<br>
have one<br>
hardware page table and there is corresponding Linux<br>
page table<br>
Entry<br>
(L_PTE_*).The "Linux" PTE definitions are as like below<br>
from<br></div>
arch/arm/include/asm/pgtable._<u></u>___h.<div><div class="h5"><br>
<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<br>
(1 <<<br>
11)| for my<br>
<br>
debugging purpose (basically to trap all the write to<br>
that page<br>
and set<br>
this bit when write happens and clear it off in another<br>
thread<br>
)? Or<br>
is there any limitation like we can use only L_PTE till<br>
10th bit ?<br>
<br>
<br>
No such limitation on bit 11, so you can use define<br>
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@" target="_blank">Kernelnewbies@</a>__<a href="http://kernelnewbies.org" target="_blank">kernel<u></u>newbies.org</a><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<div class="im"><br>
<<a href="http://lists.kernelnewbies." target="_blank">http://lists.kernelnewbies.</a>__<u></u>org/mailman/listinfo/__<u></u>kernelnewbies<br>
<<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.<u></u>org/mailman/listinfo/<u></u>kernelnewbies</a>>><br>
<br>
<br>
<br>
--<br>
Love each day!<br>
<br>
--bill<br>
<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>