summaryrefslogtreecommitdiffstats
path: root/sys/vm/uma_int.h
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2010-03-22 22:39:32 +0000
committerkmacy <kmacy@FreeBSD.org>2010-03-22 22:39:32 +0000
commit122090fb7e8c9dc016b8cb0cb8904d6be5cdb272 (patch)
tree2283e91cdbb43b46f69da81f780847560fd78ea9 /sys/vm/uma_int.h
parent0940be53d6a7b06b61e9bd34802aa26a951acc06 (diff)
downloadFreeBSD-src-122090fb7e8c9dc016b8cb0cb8904d6be5cdb272.zip
FreeBSD-src-122090fb7e8c9dc016b8cb0cb8904d6be5cdb272.tar.gz
- enable alignment on amd64 only
- only align pcpu caches and the volatile portion of uma_zone
Diffstat (limited to 'sys/vm/uma_int.h')
-rw-r--r--sys/vm/uma_int.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h
index e04dd39..27396ea 100644
--- a/sys/vm/uma_int.h
+++ b/sys/vm/uma_int.h
@@ -162,7 +162,11 @@ struct uma_hash {
/*
* align field or structure to cache line
*/
+#if defined(__amd64__)
+#define UMA_ALIGN __aligned(CACHE_LINE_SIZE)
+#else
#define UMA_ALIGN
+#endif
/*
* Structures for per cpu queues.
@@ -173,7 +177,7 @@ struct uma_bucket {
int16_t ub_cnt; /* Count of free items. */
int16_t ub_entries; /* Max items. */
void *ub_bucket[]; /* actual allocation storage */
-} UMA_ALIGN;
+};
typedef struct uma_bucket * uma_bucket_t;
@@ -330,7 +334,7 @@ struct uma_zone {
* This HAS to be the last item because we adjust the zone size
* based on NCPU and then allocate the space for the zones.
*/
- struct uma_cache uz_cpu[1] UMA_ALIGN; /* Per cpu caches */
+ struct uma_cache uz_cpu[1]; /* Per cpu caches */
};
/*
OpenPOWER on IntegriCloud