summaryrefslogtreecommitdiff
path: root/sys/kern/subr_workqueue.c
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2008-03-27 18:30:15 +0000
committerad <ad@NetBSD.org>2008-03-27 18:30:15 +0000
commitfeb4783fdf430e68e8769f3316ffda5ffc70e208 (patch)
tree12192b78f48a0a906f2cf9a902b3cd5e5fe8367e /sys/kern/subr_workqueue.c
parent0f33676c6c2ea51b5269eb51c45119ebf42142a9 (diff)
Replace use of CACHE_LINE_SIZE in some obvious places.
Diffstat (limited to 'sys/kern/subr_workqueue.c')
-rw-r--r--sys/kern/subr_workqueue.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/kern/subr_workqueue.c b/sys/kern/subr_workqueue.c
index 8c5cda97ee9..c31079c4fbb 100644
--- a/sys/kern/subr_workqueue.c
+++ b/sys/kern/subr_workqueue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_workqueue.c,v 1.23 2008/03/10 22:20:14 martin Exp $ */
+/* $NetBSD: subr_workqueue.c,v 1.24 2008/03/27 18:30:15 ad Exp $ */
/*-
* Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.23 2008/03/10 22:20:14 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.24 2008/03/27 18:30:15 ad Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -63,14 +63,8 @@ struct workqueue {
void *wq_ptr;
};
-#ifdef MULTIPROCESSOR
-#define CPU_ALIGN_SIZE CACHE_LINE_SIZE
-#else
-#define CPU_ALIGN_SIZE (ALIGNBYTES + 1)
-#endif
-
-#define WQ_SIZE (roundup2(sizeof(struct workqueue), CPU_ALIGN_SIZE))
-#define WQ_QUEUE_SIZE (roundup2(sizeof(struct workqueue_queue), CPU_ALIGN_SIZE))
+#define WQ_SIZE (roundup2(sizeof(struct workqueue), coherency_unit))
+#define WQ_QUEUE_SIZE (roundup2(sizeof(struct workqueue_queue), coherency_unit))
#define POISON 0xaabbccdd
@@ -80,7 +74,7 @@ workqueue_size(int flags)
return WQ_SIZE
+ ((flags & WQ_PERCPU) != 0 ? ncpu : 1) * WQ_QUEUE_SIZE
- + CPU_ALIGN_SIZE;
+ + coherency_unit;
}
static struct workqueue_queue *
@@ -241,7 +235,7 @@ workqueue_create(struct workqueue **wqp, const char *name,
KASSERT(sizeof(work_impl_t) <= sizeof(struct work));
ptr = kmem_zalloc(workqueue_size(flags), KM_SLEEP);
- wq = (void *)roundup2((intptr_t)ptr, CPU_ALIGN_SIZE);
+ wq = (void *)roundup2((intptr_t)ptr, coherency_unit);
wq->wq_ptr = ptr;
wq->wq_flags = flags;