aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/pcpu.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2018-07-06 19:50:25 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2018-07-06 19:50:25 +0000
commitfb0a28119668e17c848af45a2b463f8d54101b0b (patch)
tree09806e9800feea209ac26a72f107cf5e3021c566 /sys/sys/pcpu.h
parent16147166550303ef4e55db8ebea57df6e7caeba7 (diff)
downloadsrc-fb0a28119668e17c848af45a2b463f8d54101b0b.tar.gz
src-fb0a28119668e17c848af45a2b463f8d54101b0b.zip
Revert to recommit with the proper message.
Notes
Notes: svn path=/head/; revision=336046
Diffstat (limited to 'sys/sys/pcpu.h')
-rw-r--r--sys/sys/pcpu.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index cba9d6e89797..9ba2adfdbff8 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -185,6 +185,14 @@ struct pcpu {
PCPU_MD_FIELDS;
} __aligned(CACHE_LINE_SIZE);
+#ifdef CTASSERT
+/*
+ * To minimize memory waste in per-cpu UMA zones, size of struct pcpu
+ * should be denominator of PAGE_SIZE.
+ */
+CTASSERT((PAGE_SIZE / sizeof(struct pcpu)) * sizeof(struct pcpu) == PAGE_SIZE);
+#endif
+
#ifdef _KERNEL
STAILQ_HEAD(cpuhead, pcpu);
@@ -201,19 +209,6 @@ extern struct pcpu *cpuid_to_pcpu[];
#define UMA_PCPU_ALLOC_SIZE PAGE_SIZE
-#ifdef CTASSERT
-#if defined(__i386__) || defined(__amd64__)
-/* Required for counters(9) to work on x86. */
-CTASSERT(sizeof(struct pcpu) == UMA_PCPU_ALLOC_SIZE);
-#else
-/*
- * To minimize memory waste in per-cpu UMA zones, size of struct pcpu
- * should be denominator of PAGE_SIZE.
- */
-CTASSERT((PAGE_SIZE / sizeof(struct pcpu)) * sizeof(struct pcpu) == PAGE_SIZE);
-#endif /* UMA_PCPU_ALLOC_SIZE && x86 */
-#endif /* CTASSERT */
-
/* Accessor to elements allocated via UMA_ZONE_PCPU zone. */
static inline void *
zpcpu_get(void *base)