Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jun 2025 10:54:34 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        David Chisnall <theraven@freebsd.org>, Minsoo Choo <minsoochoo0122@proton.me>,  FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: Future of jemalloc on FreeBSD after archive
Message-ID:  <CANCZdfodoOdcrcOp2J=dS=VZw2wP6w%2B6uayG7mDBPJ7=Zt%2BR1Q@mail.gmail.com>
In-Reply-To: <aEgqyjfMHjV2LslN@spindle.one-eyed-alien.net>
References:  <sLUPmdWvgjaNJL3ly0NC29emSncHWcPnwkuqJ_v_T2_OsBK9BtdJcm17AeGD-2VBZp7gLEpMis-PiJG7zOueEcBhfVIlIpSVNKWfEgmKFn4=@proton.me> <CANCZdfpgLQD0sC3Hsuy542b1K%2BSpNA8xLGZ96XoOZhhLc1%2Buhg@mail.gmail.com> <44DDF236-0911-4CE8-AD30-5E1AB5CB25EB@FreeBSD.org> <aEgqyjfMHjV2LslN@spindle.one-eyed-alien.net>

index | next in thread | previous in thread | raw e-mail

On Tue, Jun 10, 2025 at 6:53 AM Brooks Davis <brooks@freebsd.org> wrote:
>
> On Tue, Jun 10, 2025 at 08:15:02AM +0100, David Chisnall wrote:
> > On 10 Jun 2025, at 00:17, Warner Losh <imp@bsdimp.com> wrote:
> > >
> > > I'm unsure what to do in the future. What are all the cool kids using today?
> >
> > I???ve replaced jemalloc with snmalloc (to which I am a contributor) in libc about five years ago and have been using that on a few places.  I believe Brooks imported a cleaned-up version of my patches to CheriBSD and was planning on upstreaming them as an option.
> >
>
> I've been doing infrastructure work for this as a background task
> due to a decision to switch back to a wrapped jemalloc for CheriBSD
> heap temporal safety work (at the time we were debugging too many
> different things at once and decided that wrapping jemalloc meant we
> were debugging fewer things).
>
> I think we should ship 15.0 with jemalloc, ideally updated to at least
> 5.3.0.  I'd also like to deprecate all the jemalloc specific symbols for
> 15 by removing default versions.  I've got a patch to do so, but probably
> need an exprun for it and maybe a shim library to allow linkage with
> those symbols.

I agree. I have staged this, but am working through a few of the last
snags in completely scripting the upgrade so that it's maximally
auditable after the xz compromise. While I don't think we have a big
risk of that, I think some caution is needed. I like the idea of
deprecating the specific symbols... but that's contingent on exprun
since I think we do use them in a few ports (or used to, I reviewed
something that did years ago).

> Longer term, pivoting to a malloc with better hardening is certainly the
> right thing to do and snmalloc is a candidate.

Yea, we need something that's maintained and still innovating. While
malloc is a relatively stable interface, getting good performance out
of it for the changing dynamic of applications requires constant study
and tuning... I don't know enough to know if snmalloc is the best
choice for us or not, but I do think we should be intentional about
this and if there's a number of people that can guide the process, so
much the better.

Warner


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfodoOdcrcOp2J=dS=VZw2wP6w%2B6uayG7mDBPJ7=Zt%2BR1Q>