summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2013-04-08 19:19:10 +0000
committerglebius <glebius@FreeBSD.org>2013-04-08 19:19:10 +0000
commit8c6eba117e357de0d074eaba6b730cc2261cd9e0 (patch)
tree417e1a1bd53ca195c061caab891a3d8d940beb2b /sys/mips
parent7f9db020a246190e72c9b9656997403221c48a3a (diff)
downloadFreeBSD-src-8c6eba117e357de0d074eaba6b730cc2261cd9e0.zip
FreeBSD-src-8c6eba117e357de0d074eaba6b730cc2261cd9e0.tar.gz
Merge from projects/counters:
Pad struct pcpu so that its size is denominator of PAGE_SIZE. This is done to reduce memory waste in UMA_PCPU_ZONE zones. Sponsored by: Nginx, Inc.
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/include/pcpu.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/mips/include/pcpu.h b/sys/mips/include/pcpu.h
index b8928a1..89b6525 100644
--- a/sys/mips/include/pcpu.h
+++ b/sys/mips/include/pcpu.h
@@ -33,13 +33,29 @@
#include <machine/pte.h>
-#define PCPU_MD_FIELDS \
+#define PCPU_MD_COMMON_FIELDS \
pd_entry_t *pc_segbase; /* curthread segbase */ \
struct pmap *pc_curpmap; /* pmap of curthread */ \
u_int32_t pc_next_asid; /* next ASID to alloc */ \
u_int32_t pc_asid_generation; /* current ASID generation */ \
u_int pc_pending_ipis; /* IPIs pending to this CPU */
+#ifdef __mips_n64
+#define PCPU_MD_MIPS64_FIELDS \
+ PCPU_MD_COMMON_FIELDS \
+ char __pad[61]
+#else
+#define PCPU_MD_MIPS32_FIELDS \
+ PCPU_MD_COMMON_FIELDS \
+ char __pad[133]
+#endif
+
+#ifdef __mips_n64
+#define PCPU_MD_FIELDS PCPU_MD_MIPS64_FIELDS
+#else
+#define PCPU_MD_FIELDS PCPU_MD_MIPS32_FIELDS
+#endif
+
#ifdef _KERNEL
extern char pcpu_space[MAXCPU][PAGE_SIZE * 2];
OpenPOWER on IntegriCloud