On Sun, Nov 16, 2025 at 10:51:01AM -0700, Warner Losh wrote:
> Maybe try main with the following patch. Adrian noticed the TLS mismatch. I
> don't think it will matter, but TLS thread model stuff always gives me a
> big headache. If the following fails to apply, just copy the
> JEMALLOC_TLS_MODEL line from i386 to arm. The default changed elsewhere,
> but this wasn't updated here.
> 
> Warner
> 
> diff --git
> a/lib/libc/stdlib/malloc/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
> b/lib/libc/stdlib/malloc/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
> index 34c86271ab2e..bd6850ebd95f 100644
> --- a/lib/libc/stdlib/malloc/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
> +++ b/lib/libc/stdlib/malloc/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
> @@ -26,10 +26,11 @@
>  #undef LG_SIZEOF_LONG
>  #undef LG_SIZEOF_INTMAX_T
> 
> +#define JEMALLOC_TLS_MODEL     __attribute__((tls_model("initial-exec")))
> +
>  #ifdef __i386__
>  #  define LG_VADDR             32
>  #  define LG_SIZEOF_PTR                2
> -#  define JEMALLOC_TLS_MODEL   __attribute__((tls_model("initial-exec")))
>  #endif
>  #ifdef __ia64__
>  #  define LG_VADDR             64
> @@ -38,7 +39,6 @@
>  #ifdef __sparc64__
>  #  define LG_VADDR             64
>  #  define LG_SIZEOF_PTR                3
> -#  define JEMALLOC_TLS_MODEL   __attribute__((tls_model("initial-exec")))
>  #endif
>  #ifdef __amd64__
>  #ifdef _USE_LG_VADDR_WIDE
> @@ -47,7 +47,6 @@
>  #  define LG_VADDR             48
>  #endif
>  #  define LG_SIZEOF_PTR                3
> -#  define JEMALLOC_TLS_MODEL   __attribute__((tls_model("initial-exec")))
>  #endif
>  #ifdef __arm__
>  #  define LG_VADDR             32
> @@ -69,11 +68,9 @@
>  #ifdef __powerpc64__
>  #  define LG_VADDR             64
>  #  define LG_SIZEOF_PTR                3
> -#  define JEMALLOC_TLS_MODEL   __attribute__((tls_model("initial-exec")))
>  #elif defined(__powerpc__)
>  #  define LG_VADDR             32
>  #  define LG_SIZEOF_PTR                2
> -#  define JEMALLOC_TLS_MODEL   __attribute__((tls_model("initial-exec")))
>  #endif
>  #ifdef __riscv
>  #  define LG_VADDR             48
> 
> 
> 

Is it still advisable to apply this patch? I'm guessing it'll get committed on 
its
own in due course. Its present lack seems harmless. 

One of the Pi2's has now completed two complete cycles of self-hosting, with no 
problems of any kind. No silent hangs, no assertion failures. The 
double-cleandir
rebuild also worked with no difficulty. It even seems to boot a little faster 
8-)

More seriously, is the path forward even hinted at yet? It seems jemalloc is
getting considerable attention but I'm not reading reports of 'Eureka!'. Am I
right in thinking git will preserve the reversion when pulling other updates?
Does anything special need to be done if an updated jemalloc is committed to
-current?

Many thanks to all who've helped!

bob prohaska




Reply via email to