question about amd64 pagetable page allocation.

Mark Tinguely marktinguely at gmail.com
Tue Apr 3 19:18:40 UTC 2012


On Tue, Apr 3, 2012 at 1:52 PM, vasanth rao naik sabavat
<vasanth.raonaik at gmail.com> wrote:
> Hello Mark,
>
> I think pmap_remove_pages() is executed only for the current process.
>
>    2549 #ifdef PMAP_REMOVE_PAGES_CURPROC_ONLY
>    2550     if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) {
>    2551         printf("warning: pmap_remove_pages called with non-current
> pmap\n");
>    2552         return;
>    2553     }
>    2554 #endif
>
> I dont still get it why this was removed?
>
> Thanks,
> Vasanth


That is pretty old code. Newer code does not make that assumption.

Without the assumption that the pages are from the current map, then you
have to use the direct physical -> virtual mapping:

2547 	#ifdef PMAP_REMOVE_PAGES_CURPROC_ONLY
2548 	pte = vtopte(pv->pv_va);
2549 	#else
2550 	pte = pmap_pte(pmap, pv->pv_va);
2551 	#endif

--Mark Tinguely.


More information about the freebsd-hackers mailing list