jemalloc: set LG_VADDR to 64 on amd64
and allow to revert it back to 48 with WITHOUT_JEMALLOC_LG_VADDR_WIDE build option. Reviewed by: andrew, emaste Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46686
This commit is contained in:
@@ -39,7 +39,11 @@
|
|||||||
# define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
|
# define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
|
||||||
#endif
|
#endif
|
||||||
#ifdef __amd64__
|
#ifdef __amd64__
|
||||||
|
#ifdef _USE_LG_VADDR_WIDE
|
||||||
|
# define LG_VADDR 64
|
||||||
|
#else
|
||||||
# define LG_VADDR 48
|
# define LG_VADDR 48
|
||||||
|
#endif
|
||||||
# define LG_SIZEOF_PTR 3
|
# define LG_SIZEOF_PTR 3
|
||||||
# define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
|
# define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ JEMALLOCSRCS:= jemalloc.c arena.c background_thread.c base.c bin.c bitmap.c \
|
|||||||
test_hooks.c ticker.c tsd.c witness.c
|
test_hooks.c ticker.c tsd.c witness.c
|
||||||
|
|
||||||
CFLAGS+=-I${SRCTOP}/contrib/jemalloc/include
|
CFLAGS+=-I${SRCTOP}/contrib/jemalloc/include
|
||||||
|
.if ${MK_JEMALLOC_LG_VADDR_WIDE} != no
|
||||||
|
CFLAGS+=-D_USE_LG_VADDR_WIDE
|
||||||
|
.endif
|
||||||
|
|
||||||
.for src in ${JEMALLOCSRCS}
|
.for src in ${JEMALLOCSRCS}
|
||||||
MISRCS+=jemalloc_${src}
|
MISRCS+=jemalloc_${src}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ __DEFAULT_YES_OPTIONS = \
|
|||||||
IPFW \
|
IPFW \
|
||||||
ISCSI \
|
ISCSI \
|
||||||
JAIL \
|
JAIL \
|
||||||
|
JEMALLOC_LG_VADDR_WIDE \
|
||||||
KDUMP \
|
KDUMP \
|
||||||
KVM \
|
KVM \
|
||||||
LDNS \
|
LDNS \
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Disallow programs to use more than 48 address bits on amd64.
|
||||||
|
Incompatible with LA57 mode.
|
||||||
|
Enabling this option might result in a slight reduction in memory
|
||||||
|
consumption for jemalloc metadata, but also requires disabling LA57
|
||||||
|
(if hardware supports it).
|
||||||
Reference in New Issue
Block a user