Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Nov 2016 17:03:21 +0000 (UTC)
From:      Svatopluk Kraus <skra@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308569 - head/sys/arm/arm
Message-ID:  <201611121703.uACH3L3x020253@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: skra
Date: Sat Nov 12 17:03:21 2016
New Revision: 308569
URL: https://svnweb.freebsd.org/changeset/base/308569

Log:
  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

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c	Sat Nov 12 05:09:39 2016	(r308568)
+++ head/sys/arm/arm/pmap-v6.c	Sat Nov 12 17:03:21 2016	(r308569)
@@ -2739,21 +2739,15 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_
 /*
  *  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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611121703.uACH3L3x020253>