From nobody Tue Jun 10 15:22:04 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGswQ1XHqz5xnHw for ; Tue, 10 Jun 2025 15:22:14 +0000 (UTC) (envelope-from minsoochoo0122@proton.me) Received: from mail-43167.protonmail.ch (mail-43167.protonmail.ch [185.70.43.167]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "protonmail.com", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGswP6ZjYz3SGB for ; Tue, 10 Jun 2025 15:22:13 +0000 (UTC) (envelope-from minsoochoo0122@proton.me) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1749568930; x=1749828130; bh=xeZwXCMlNXbHMqSFhXMOtCxo+CZepZjjZuWDVRu5pLE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=P8kJc18eDYf7AZHQAjCzOunGyYklMoTAjyT9fSG9Nhxh6KufGZkkLiXgfIITQ6Rfg rn11X5fCz6BMRoWEvjMy8Zj/kqZFRoD3CDBQirdBWED81lrhN2B9G+GHClXfHTvv9k 4MrGmjFLUGZhjPuxunuqxn5kiPj4De0WmDlx8SimtpBrE9wbS3Wa3s6mP3nYikP9up PtLjwnvIsofL1VIOnFHn9XIaFPpuA6QH1QlzXf6L9c91tdj/oaUYkHS/QyxSoDISPI M27UROe94Xr6wl2D+1RnAE4+ugu8O7DC7Gn3l2eUzlKUMIhf8c5WtHLsOfXvEdP32P 3tkboSzush7xg== Date: Tue, 10 Jun 2025 15:22:04 +0000 To: Warner Losh From: Minsoo Choo Cc: FreeBSD CURRENT Subject: Re: Future of jemalloc on FreeBSD after archive Message-ID: In-Reply-To: References: Feedback-ID: 45891198:user:proton X-Pm-Message-ID: 31b66fe1b5a6321fbdfde382dc70350bb1886c8a List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bGswP6ZjYz3SGB X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:62371, ipnet:185.70.43.0/24, country:CH] These are some replacements for jemalloc I found on the internet. Some of t= hem might not be suitable for our use cases. mimalloc by Microsoft - They claim it has better performance than jemalloc = and tcmalloc. It is also used for Bun, a javascript runtime for Node.js. Se= curity features like "guard pages, randomized allocation, encrypted free li= sts, etc" can be achieve with the hardened version with 10% performance pen= alty. tcmalloc by Google - Used by Google projects, but I'm not sure how Google'= s Bazel build system can be transformed well to our BSDmake. (No one wants = complicated makefiles, especially for malloc and libc) It is only supported= on Linux, so we need extra effort to port them to FreeBSD. Hoard - "malloc that can dramatically improve application performance, espe= cially for multithreaded programs running on multiprocessors and multicore = CPUs". Does not have any security feature on the README file. No support fo= r FreeBSD yet. rpcmalloc - "lock free thread caching 16-byte aligned memory allocator impl= emented in C". No support for FreeBSD yet. Mesh - "a drop in replacement for malloc(3) that can transparently recover = from memory fragmentation without any changes to application code." But lik= e tcmalloc, it uses Bazel build system. No support for FreeBSD yet. snmalloc by Microsoft - David's suggestion. Yet mimalloc also provides some= security features ("guard pages, randomized allocation, encrypted free lis= ts, etc. to protect against various heap vulnerabilities") as well. Still i= n 0.x stage. snmalloc and mimalloc look great for me, but my only concern is that snmall= oc is still in 0.x stage. On Monday, June 9th, 2025 at 7:17 PM, Warner Losh wrote: > I still think it would be useful to import the version that Minsoo > started (I've re-created the import he did in a way I (or anybody) can > 100% audit).. I've not had the couple of adjacent days to get this > in... It's >< close. > > > I'm unsure what to do in the future. What are all the cool kids using tod= ay? > > Warner > > On Mon, Jun 9, 2025 at 2:08=E2=80=AFPM Minsoo Choo minsoochoo0122@proton.= me wrote: > > > As of June 2, 2025, jemalloc repository on Github has been archived. [1= ] > > I have a differential revision open for jemalloc 5.3.0 [2], but have no= idea how we will fix bugs and improve jemalloc on FreeBSD after the archiv= e. > > > > We could fork the repository to freebsd/jemalloc and continue to develo= p by ourselves. Then, we need to build our own CI systems for jemalloc to t= est on macOS/Linux as well. > > > > I CC'ed Warner as he guided me for D41421, so I'm seeking for his advic= e this time as well. > > > > [1] https://github.com/jemalloc/jemalloc > > [2] https://reviews.freebsd.org/D41421