Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jan 2019 11:14:20 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r343424 - stable/12/sys/vm
Message-ID:  <201901251114.x0PBEKxO011230@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Jan 25 11:14:20 2019
New Revision: 343424
URL: https://svnweb.freebsd.org/changeset/base/343424

Log:
  MFC r343145:
  MI VM: Make it possible to set size of superpage at boot instead of compile
  time.

Modified:
  stable/12/sys/vm/vm_phys.c
  stable/12/sys/vm/vm_phys.h
  stable/12/sys/vm/vm_reserv.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/vm/vm_phys.c
==============================================================================
--- stable/12/sys/vm/vm_phys.c	Fri Jan 25 11:12:22 2019	(r343423)
+++ stable/12/sys/vm/vm_phys.c	Fri Jan 25 11:14:20 2019	(r343424)
@@ -106,7 +106,8 @@ static struct rwlock_padalign vm_phys_fictitious_reg_l
 MALLOC_DEFINE(M_FICT_PAGES, "vm_fictitious", "Fictitious VM pages");
 
 static struct vm_freelist __aligned(CACHE_LINE_SIZE)
-    vm_phys_free_queues[MAXMEMDOM][VM_NFREELIST][VM_NFREEPOOL][VM_NFREEORDER];
+    vm_phys_free_queues[MAXMEMDOM][VM_NFREELIST][VM_NFREEPOOL]
+    [VM_NFREEORDER_MAX];
 
 static int __read_mostly vm_nfreelists;
 

Modified: stable/12/sys/vm/vm_phys.h
==============================================================================
--- stable/12/sys/vm/vm_phys.h	Fri Jan 25 11:12:22 2019	(r343423)
+++ stable/12/sys/vm/vm_phys.h	Fri Jan 25 11:14:20 2019	(r343424)
@@ -42,6 +42,10 @@
 
 #ifdef _KERNEL
 
+#ifndef VM_NFREEORDER_MAX
+#define	VM_NFREEORDER_MAX	VM_NFREEORDER
+#endif
+
 /* Domains must be dense (non-sparse) and zero-based. */
 struct mem_affinity {
 	vm_paddr_t start;
@@ -63,7 +67,7 @@ struct vm_phys_seg {
 	vm_paddr_t	end;
 	vm_page_t	first_page;
 	int		domain;
-	struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER];
+	struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX];
 };
 
 extern struct vm_phys_seg vm_phys_segs[];

Modified: stable/12/sys/vm/vm_reserv.c
==============================================================================
--- stable/12/sys/vm/vm_reserv.c	Fri Jan 25 11:12:22 2019	(r343423)
+++ stable/12/sys/vm/vm_reserv.c	Fri Jan 25 11:14:20 2019	(r343424)
@@ -77,10 +77,15 @@ __FBSDID("$FreeBSD$");
 
 #if VM_NRESERVLEVEL > 0
 
+#ifndef VM_LEVEL_0_ORDER_MAX
+#define	VM_LEVEL_0_ORDER_MAX	VM_LEVEL_0_ORDER
+#endif
+
 /*
  * The number of small pages that are contained in a level 0 reservation
  */
 #define	VM_LEVEL_0_NPAGES	(1 << VM_LEVEL_0_ORDER)
+#define	VM_LEVEL_0_NPAGES_MAX	(1 << VM_LEVEL_0_ORDER_MAX)
 
 /*
  * The number of bits by which a physical address is shifted to obtain the
@@ -114,6 +119,7 @@ typedef	u_long		popmap_t;
  * The number of population map entries in a reservation
  */
 #define	NPOPMAP		howmany(VM_LEVEL_0_NPAGES, NBPOPMAP)
+#define	NPOPMAP_MAX	howmany(VM_LEVEL_0_NPAGES_MAX, NBPOPMAP)
 
 /*
  * Number of elapsed ticks before we update the LRU queue position.  Used
@@ -191,7 +197,7 @@ struct vm_reserv {
 	uint16_t	popcnt;			/* (r) # of pages in use */
 	int		lasttick;		/* (r) last pop update tick. */
 	char		inpartpopq;		/* (d) */
-	popmap_t	popmap[NPOPMAP];	/* (r) bit vector, used pages */
+	popmap_t	popmap[NPOPMAP_MAX];	/* (r) bit vector, used pages */
 };
 
 #define	vm_reserv_lockptr(rv)		(&(rv)->lock)



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