]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLENAUP: config: move CONFIG_HAP_LOCKLESS_POOLS out of config.h
authorWilly Tarreau <w@1wt.eu>
Sat, 9 May 2020 07:02:35 +0000 (09:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 9 May 2020 07:02:35 +0000 (09:02 +0200)
The setting of CONFIG_HAP_LOCKLESS_POOLS depending on threads and
compat was done in config.h for use only in memory.h and memory.c
where other settings are dealt with. Further, the default pool cache
size was set there from a fixed value instead of being set from
defaults.h

Let's move the decision to enable lockless pools via
CONFIG_HAP_LOCKLESS_POOLS to memory.h, and set the default pool
cache size in defaults.h like other default settings.

This was the next-to-last setting in config.h.

include/common/config.h
include/common/defaults.h
include/common/memory.h

index 9d7bf88e2f20cb2cde3ca1953e6670032824b8fe..365705c4c3d64132618dbc4b87c2f32e97210971 100644 (file)
 #define THREAD_LOCAL
 #endif
 
-/* On architectures supporting threads and double-word CAS, we can implement
- * lock-less memory pools. This isn't supported for debugging modes however.
- */
-#if defined(USE_THREAD) && defined(HA_HAVE_CAS_DW) && !defined(DEBUG_NO_LOCKLESS_POOLS) && !defined(DEBUG_UAF) && !defined(DEBUG_FAIL_ALLOC)
-#define CONFIG_HAP_LOCKLESS_POOLS
-#ifndef CONFIG_HAP_POOL_CACHE_SIZE
-#define CONFIG_HAP_POOL_CACHE_SIZE 524288
-#endif
-#endif
-
 #endif /* _COMMON_CONFIG_H */
index 335082518559e49e53309e985db95636f90a10f3..aeddb0108e86f241787c9047e4b1a4c037d502fc 100644 (file)
 #define MEM_USABLE_RATIO 0.97
 #endif
 
+/* default per-thread pool cache size when enabled */
+#ifndef CONFIG_HAP_POOL_CACHE_SIZE
+#define CONFIG_HAP_POOL_CACHE_SIZE 524288
+#endif
+
 /* Number of samples used to compute the times reported in stats. A power of
  * two is highly recommended, and this value multiplied by the largest response
  * time must not overflow and unsigned int. See freq_ctr.h for more information.
index 44a9dcb57609b503bc60c9f9a8b56a4c5e949bc2..7bcef94ea7a29822b259ec00872f50d240c14978 100644 (file)
 #include <common/hathreads.h>
 #include <common/initcall.h>
 
+/* On architectures supporting threads and double-word CAS, we can implement
+ * lock-less memory pools. This isn't supported for debugging modes however.
+ */
+#if defined(USE_THREAD) && defined(HA_HAVE_CAS_DW) && !defined(DEBUG_NO_LOCKLESS_POOLS) && !defined(DEBUG_UAF) && !defined(DEBUG_FAIL_ALLOC)
+#define CONFIG_HAP_LOCKLESS_POOLS
+#endif
+
 #ifndef DEBUG_DONT_SHARE_POOLS
 #define MEM_F_SHARED   0x1
 #else