Re: Page references

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Akshay...
while reading about page replacement algos, i have a doubt....
whenever page table entries are set, pages will be accessed without
knowledge of kernel. So how no. of references made to a page present in
cache are found out?? (especially in frquency based algos)


This is how I understand the mechanism. If you access those pages directly i.e using something like mov <address> $variable, of course kernel won't recognize it and page count reference can not be adjusted. IIRC, the best the MMU unit can do is simply turn the "accessed" bit on in the related PTE.

Page count reference is adjusted when you access them via wrapper functions. I am not able to tell the exact function names, but here is example scenario. You mmap() a file... then some data chunks are brought into page cache. Since this is the only process right now which accesses them, page ref count is set as 0. Later, while still mmap()-ing them, another process also want to mmap() the same file. This time, they are found on page cache, thus page ref count are incremented by 1.

Minutes later, they are no longer needed by both processes. Unmap() is called, releasing the pages from process address space's mapping. Then page ref count are back to zero.

I hope I illustrate the situation correctly for you and enough to bring enlightenment.

regards,

Mulyadi


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux