how to get PFN of page cache?
i want to develop linux kernel module that will get PFN of pagecache pages. please help me how to develop this kind of kernel module. -- pravin jadav M.Tech (IT pursuing )
On Mar 20, 2014 5:22 PM, "pravin jadav" <pravin.jadav17@gmail.com> wrote:
i want to develop linux kernel module that will get PFN of pagecache
pages.
please help me how to develop this kind of kernel module.
See drop_pagecache_sb. What exactly you need?? I don't think you'll need to modify or access the memory defined by that page. So i guess you could do a lockless version when you iterate over pages.
--
pravin jadav M.Tech (IT pursuing )
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Pravin, I think Pravin wants to know the Page Frame Number in memory management.(virtual<->physical conversion) But the function drop_pagecache_sb seems to be about the disk cache(file magement or block layer). Chan ________________________________ From : "Pranay Srivastava" <pranjas@gmail.com> Sent : 2014-03-20 22:05:30 ( +09:00 ) To : pravin jadav <pravin.jadav17@gmail.com> Cc : Kernelnewbies@kernelnewbies.org <Kernelnewbies@kernelnewbies.org> Subject : Re: how to get PFN of page cache? On Mar 20, 2014 5:22 PM, "pravin jadav" <pravin.jadav17@gmail.com<mailto:pravin.jadav17@gmail.com>> wrote:
i want to develop linux kernel module that will get PFN of pagecache pages. please help me how to develop this kind of kernel module.
See drop_pagecache_sb. What exactly you need?? I don't think you'll need to modify or access the memory defined by that page. So i guess you could do a lockless version when you iterate over pages.
--
pravin jadav M.Tech (IT pursuing )
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org<mailto:Kernelnewbies@kernelnewbies.org> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
basically i need to develop kernel module that get PFN of page cache and is corresponding disk block number. after getting PFN and Disk block number, user space program transfer PFN and Disk blick number to the source VMM and remote VMM. i use that module in virtual machine(VM) live migration.
Oh, I see. By PFN of page cache, do you mean the one in the memory management unit? Or is there another page cache for the disk cache(I’m not sure if there’s one)? ----------------------- From: pravin jadav [mailto:pravin.jadav17@gmail.com] Sent: Friday, March 21, 2014 1:08 PM To: 김찬; Valdis Kletnieks Cc: Pranay Srivastava; Kernelnewbies@kernelnewbies.org Subject: Re: how to get PFN of page cache? basically i need to develop kernel module that get PFN of page cache and is corresponding disk block number. after getting PFN and Disk block number, user space program transfer PFN and Disk blick number to the source VMM and remote VMM. i use that module in virtual machine(VM) live migration.
On Thu, 20 Mar 2014 17:14:57 +0530, pravin jadav said:
i want to develop linux kernel module that will get PFN of pagecache pages. please help me how to develop this kind of kernel module.
What do you intend to do with the page once you find its PFN? It's quite possible there's already an API to do what you want without even needing its PFN - or good technical reasons to not do what your module intends to do once it has the PFN....
There are some functions to probe (look into) the page tables (for current context.. maybe for all the conext too). look under /arch/x86(yours)/mm. This page table is in the memory so the S/W can probe it. But I don't think we can see whan page table entries we have in the page descriptor cache (that's stored by the MMU hardware). Chan ________________________________ From : "Valdis.Kletnieks@vt.edu" <Valdis.Kletnieks@vt.edu> Sent : 2014-03-21 03:49:36 ( +09:00 ) To : pravin jadav <pravin.jadav17@gmail.com> Cc : Kernelnewbies@kernelnewbies.org <Kernelnewbies@kernelnewbies.org> Subject : Re: how to get PFN of page cache? On Thu, 20 Mar 2014 17:14:57 +0530, pravin jadav said:
i want to develop linux kernel module that will get PFN of pagecache pages. please help me how to develop this kind of kernel module.
What do you intend to do with the page once you find its PFN? It's quite possible there's already an API to do what you want without even needing its PFN - or good technical reasons to not do what your module intends to do once it has the PFN....
participants (5)
-
Chan Kim -
Pranay Srivastava -
pravin jadav -
Valdis.Kletnieks@vt.edu -
김찬