Always call PHYS_TO_VM_PAGE() in is_managed(). Fast road for addresses

under first_page cannot be taken as this variable is connected only to
vm_page_array segment. There could be more segments in system like
the ones for various fictitious page ranges. These can be situated
under vm_page_array segment and so, they could be skipped before this
fix. However, as far as I know, there is no report associated with it.

While here, the return type of this function is changed from boolean_t
to bool type.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D8502
This commit is contained in:
Svatopluk Kraus 2016-11-12 17:03:21 +00:00
parent 1f842820e1
commit b75f7c6cfb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=308569

View File

@ -2739,21 +2739,15 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_spare, CTLFLAG_RD, &pv_entry_spare, 0,
/*
* Is given page managed?
*/
static __inline boolean_t
static __inline bool
is_managed(vm_paddr_t pa)
{
vm_offset_t pgnum;
vm_page_t m;
pgnum = atop(pa);
if (pgnum >= first_page) {
m = PHYS_TO_VM_PAGE(pa);
if (m == NULL)
return (FALSE);
if ((m->oflags & VPO_UNMANAGED) == 0)
return (TRUE);
}
return (FALSE);
m = PHYS_TO_VM_PAGE(pa);
if (m == NULL)
return (false);
return ((m->oflags & VPO_UNMANAGED) == 0);
}
static __inline boolean_t