summaryrefslogtreecommitdiff
path: root/usr/src/uts/sun4/os/startup.c
diff options
context:
space:
mode:
authorPeter Rival <Frank.Rival@oracle.com>2010-04-23 13:26:05 -0400
committerPeter Rival <Frank.Rival@oracle.com>2010-04-23 13:26:05 -0400
commitcb15d5d96b3b2730714c28bfe06cfe7421758b8c (patch)
tree7fd5c3cf5bb49647be8b2eb022e8d75a7d78eab5 /usr/src/uts/sun4/os/startup.c
parent03c76a6ef5c04e818b6badeeb6155961505af45c (diff)
downloadillumos-joyent-cb15d5d96b3b2730714c28bfe06cfe7421758b8c.tar.gz
6778289 vm locks need to scale with the size of system (strands/memory size)
Diffstat (limited to 'usr/src/uts/sun4/os/startup.c')
-rw-r--r--usr/src/uts/sun4/os/startup.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr/src/uts/sun4/os/startup.c b/usr/src/uts/sun4/os/startup.c
index 914451cf4f..fe1dffc468 100644
--- a/usr/src/uts/sun4/os/startup.c
+++ b/usr/src/uts/sun4/os/startup.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/machsystm.h>
@@ -62,6 +61,7 @@
#include <sys/memnode.h>
#include <sys/mem_cage.h>
#include <sys/mmu.h>
+#include <sys/swap.h>
extern void setup_trap_table(void);
extern int cpu_intrq_setup(struct cpu *);
@@ -174,6 +174,7 @@ pgcnt_t obp_pages; /* Physical pages used by OBP */
* VM data structures
*/
long page_hashsz; /* Size of page hash table (power of two) */
+unsigned int page_hashsz_shift; /* log2(page_hashsz) */
struct page *pp_base; /* Base of system page struct array */
size_t pp_sz; /* Size in bytes of page struct array */
struct page **page_hash; /* Page hash table */
@@ -748,13 +749,16 @@ calc_kpmpp_sz(pgcnt_t npages)
size_t
calc_pagehash_sz(pgcnt_t npages)
{
-
+ /* LINTED */
+ ASSERT(P2SAMEHIGHBIT((1 << PP_SHIFT), (sizeof (struct page))));
/*
* The page structure hash table size is a power of 2
* such that the average hash chain length is PAGE_HASHAVELEN.
*/
page_hashsz = npages / PAGE_HASHAVELEN;
- page_hashsz = 1 << highbit(page_hashsz);
+ page_hashsz_shift = MAX((AN_VPSHIFT + VNODE_ALIGN_LOG2 + 1),
+ highbit(page_hashsz));
+ page_hashsz = 1 << page_hashsz_shift;
return (page_hashsz * sizeof (struct page *));
}