Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2018 17:22:41 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r337467 - stable/11/sys/vm
Message-ID:  <201808081722.w78HMf6j096937@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Wed Aug  8 17:22:41 2018
New Revision: 337467
URL: https://svnweb.freebsd.org/changeset/base/337467

Log:
  MFC r337265:
  Add the required page accounting to kmem_bootstrap_free().

Modified:
  stable/11/sys/vm/vm_kern.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_kern.c
==============================================================================
--- stable/11/sys/vm/vm_kern.c	Wed Aug  8 17:12:06 2018	(r337466)
+++ stable/11/sys/vm/vm_kern.c	Wed Aug  8 17:22:41 2018	(r337467)
@@ -549,6 +549,7 @@ void
 kmem_bootstrap_free(vm_offset_t start, vm_size_t size)
 {
 #if defined(__i386__) || defined(__amd64__)
+	struct vm_domain *vmd;
 	vm_offset_t end, va;
 	vm_paddr_t pa;
 	vm_page_t m;
@@ -560,9 +561,14 @@ kmem_bootstrap_free(vm_offset_t start, vm_size_t size)
 		pa = pmap_kextract(va);
 		m = PHYS_TO_VM_PAGE(pa);
 
+		vmd = vm_phys_domain(m);
 		mtx_lock(&vm_page_queue_free_mtx);
 		vm_phys_free_pages(m, 0);
+		vmd->vmd_page_count++;
+		vm_phys_freecnt_adj(m, 1);
 		mtx_unlock(&vm_page_queue_free_mtx);
+
+		vm_cnt.v_page_count++;
 	}
 	pmap_remove(kernel_pmap, start, end);
 	(void)vmem_add(kernel_arena, start, end - start, M_WAITOK);



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