--- El mié 21-sep-11, Sri Ram Vemulpali <[email protected]> escribió:
> De: Sri Ram Vemulpali <[email protected]> > Asunto: Re: question on memory mapping one page at a time > Para: "rohan puri" <[email protected]> > Cc: "Jeff Haran" <[email protected]>, "kernelnewbies" > <[email protected]> > Fecha: miércoles, 21 de septiembre de 2011, 15:06 > thanks for the replies. > > On Tue, Sep 20, 2011 at 11:42 PM, rohan puri <[email protected]> > wrote: > > > > > > On Wed, Sep 21, 2011 at 2:24 AM, Jeff Haran <[email protected]> > wrote: > >> > >> > -----Original Message----- > >> > From: [email protected] > [mailto:kernelnewbies- > >> > [email protected]] > On Behalf Of Sri Ram Vemulpali > >> > Sent: Tuesday, September 20, 2011 11:24 AM > >> > To: kernelnewbies > >> > Subject: question on memory mapping one page > at a time > >> > > >> > Hi all, > >> > > >> > can anyone please explain the following code, > what it is doing. I want > >> > the first few statements of the code, as > they are calculating page > >> > frame number. This is little confusing, > thanks in advance. > >> > > >> > struct page *simple_vma_nopage(struct > vm_area_struct *vma, > >> > unsigned long > address, int *type) > >> > { > >> > struct page *pageptr; > >> > unsigned long offset = vma->vm_pgoff > << PAGE_SHIFT; > >> > unsigned long physaddr = address - > vma->vm_start + offset; > >> > unsigned long pageframe = physaddr > >> PAGE_SHIFT; > >> > if (!pfn_valid(pageframe)) > >> > return NOPAGE_SIGBUS; > >> > pageptr = pfn_to_page(pageframe); > >> > get_page(pageptr); > >> > if (type) > >> > *type = VM_FAULT_MINOR; > >> > return pageptr; > >> > } > >> > > >> > -- > >> > Regards, > >> > Sri. > >> > >> Do a search on "Understanding the Linux Virtual > Memory Manager" by Mel > >> Gorman. The PDF is out there for free or you can > buy the hardcopy. Does this means that Gorman's book is still useful? I thought it was too outdated. _______________________________________________ Kernelnewbies mailing list [email protected] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
