1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

By the time that pmap_init() runs, vm_phys_segs[] has been initialized. Obtaining

the end of memory address from vm_phys_segs[] is a little easier than obtaining it
from phys_avail[].

Discussed with:	Svatopluk Kraus
This commit is contained in:
Alan Cox 2014-10-26 17:56:47 +00:00
parent 1bc2fdfabf
commit d6e53ebe5e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273701
3 changed files with 10 additions and 6 deletions

View File

@ -131,6 +131,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_extern.h>
#include <vm/vm_pageout.h>
#include <vm/vm_pager.h>
#include <vm/vm_phys.h>
#include <vm/vm_radix.h>
#include <vm/vm_reserv.h>
#include <vm/uma.h>
@ -1056,8 +1057,7 @@ pmap_init(void)
/*
* Calculate the size of the pv head table for superpages.
*/
for (i = 0; phys_avail[i + 1]; i += 2);
pv_npg = round_2mpage(phys_avail[(i - 2) + 1]) / NBPDR;
pv_npg = howmany(vm_phys_segs[vm_phys_nsegs - 1].end, NBPDR);
/*
* Allocate memory for the pv head table for superpages.

View File

@ -172,6 +172,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_map.h>
#include <vm/vm_page.h>
#include <vm/vm_pageout.h>
#include <vm/vm_phys.h>
#include <vm/vm_extern.h>
#include <vm/vm_reserv.h>
@ -1342,9 +1343,10 @@ pmap_init(void)
/*
* Calculate the size of the pv head table for superpages.
* Handle the possibility that "vm_phys_segs[...].end" is zero.
*/
for (i = 0; phys_avail[i + 1]; i += 2);
pv_npg = round_1mpage(phys_avail[(i - 2) + 1]) / NBPDR;
pv_npg = trunc_1mpage(vm_phys_segs[vm_phys_nsegs - 1].end -
PAGE_SIZE) / NBPDR + 1;
/*
* Allocate memory for the pv head table for superpages.

View File

@ -133,6 +133,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_extern.h>
#include <vm/vm_pageout.h>
#include <vm/vm_pager.h>
#include <vm/vm_phys.h>
#include <vm/vm_radix.h>
#include <vm/vm_reserv.h>
#include <vm/uma.h>
@ -778,9 +779,10 @@ pmap_init(void)
/*
* Calculate the size of the pv head table for superpages.
* Handle the possibility that "vm_phys_segs[...].end" is zero.
*/
for (i = 0; phys_avail[i + 1]; i += 2);
pv_npg = round_4mpage(phys_avail[(i - 2) + 1]) / NBPDR;
pv_npg = trunc_4mpage(vm_phys_segs[vm_phys_nsegs - 1].end -
PAGE_SIZE) / NBPDR + 1;
/*
* Allocate memory for the pv head table for superpages.