util: Move CACHE_LINE_SIZE here.
authorBen Pfaff <blp@nicira.com>
Tue, 11 Mar 2014 07:10:20 +0000 (00:10 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 13 Mar 2014 19:45:15 +0000 (12:45 -0700)
It will come in handy elsewhere in upcoming commits.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
lib/fat-rwlock.c
lib/util.h

index 9ffa37b..3866dda 100644 (file)
 #include "ovs-thread.h"
 #include "random.h"
 
-/* This system's cache line size, in bytes.
- * Being wrong hurts performance but not correctness. */
-#define CACHE_LINE_SIZE 64      /* Correct for most CPUs. */
-BUILD_ASSERT_DECL(IS_POW2(CACHE_LINE_SIZE));
-
 struct fat_rwlock_slot {
     /* Membership in rwlock's list of "struct fat_rwlock_slot"s.
      *
index 8c4d9d6..c1672e5 100644 (file)
@@ -145,6 +145,11 @@ is_pow2(uintmax_t x)
 #define RDP2_4(X) (RDP2_5(X) | (RDP2_5(X) >> 2))
 #define RDP2_5(X) (      (X) | (      (X) >> 1))
 
+/* This system's cache line size, in bytes.
+ * Being wrong hurts performance but not correctness. */
+#define CACHE_LINE_SIZE 64
+BUILD_ASSERT_DECL(IS_POW2(CACHE_LINE_SIZE));
+
 #ifndef MIN
 #define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
 #endif