On Thu, 26 Jun 2003, Ravi wrote: > > --- "Raghu R. Arur" <rra2002@cs.columbia.edu> wrote: > > > > If I am not wrong, Rik van Riel wrote the rmap feature > > > to do what you are trying to do. You might want to look > > > at mm/rmap.c in the 2.5.x source tree to see how you can > > > use this feature. > > > > > > -Ravi. > > > > > > I dont think Rik's rmap does what is needed. I mean > > given a page , tell us which process owns the page. > > > > what rmap does is that is creates a chain of pte_t > > for shared pages. This helps us to know all the page table > > entries of a shared page. > > True. But if you want to do anything with those chained > PTE's, there should be a way to lock the page table of the > process to which the PTE belongs, right? So I assumed there > will be some way to reach the task structure from the PTE. > > But I looked at the code and found I was wrong. From the > chained PTE, you can get to the corresponding task's > mm_struct. And page_table_lock, which rmap needs, is > a member of mm_struct. So there is no need to get to the > task structure. > mm_struct does not point back to any task strucutre, > possibly because it can be shared across threads. Without > this, page-->process mapping is difficult. > (But it is a lot easier now: instead of scanning the > page table of every process, one loop over the task > list to see which task points to the required mm_struct > is sufficient. Ugly, but still...) hey, u r right. But i have question here. the function ptep_to_mm(pte_t*) gives the mm_struct the page is associated to. The comment in linux/include/asm-generic/rmap.h says that page->mapping points to the process' mm_struct. But if you see the struct page it is no different from the previous kernel i.e mapping points to the inode or someother address_space based on the mapping of the page. I really dint understand how mapping can return the mm_struct of the process that page is associated with. do you know how this works?? thanks, raghu > > -Ravi. > > > > __________________________________ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/