From nobody Tue Jun 10 16:54:34 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 4bGvzF3CNBz5xwW9 for ; Tue, 10 Jun 2025 16:54:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGvzF2ps0z3mjP for ; Tue, 10 Jun 2025 16:54:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-312116d75a6so4461253a91.3 for ; Tue, 10 Jun 2025 09:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749574487; x=1750179287; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=y/nA0QYSvXtsgn4V+N36pnEn7dHe4GfM3CctklrEgTI=; b=XtXPmb0ZnxB1OjtJSHnTxTpkKiAFX6nJsefCxP8jVO+y/bOlRktxEHsB6Qbswg5IL5 Y6bLmSd+GrG3QZGeHid3OfGC0NlZ4CRdwSBsVna5EWBnW3IOFohKJ3ZGXZfdMkR3C5I0 c3G8uDv/S//3131S0E65wd3EZj2IX36ivmG2qOCtQ+u/GPfruEignfnVDc0BGWGdgTwW WNKzSvLE1LrLUwIXnThCUVrCmUOdTFH/AH97Koll19aAsr2a778MByPJ0FFuDY01PB/k EzMfqz5crjV+rZ3WlyIjW7oaA6EK4Dn4M5OPO5OkhpQhDlwJuZmcYVuJsm0cbiqlTuZx rfww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749574487; x=1750179287; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y/nA0QYSvXtsgn4V+N36pnEn7dHe4GfM3CctklrEgTI=; b=LESekwY376i9ZHMV27AhYPumHC7s8DvfqvD0ktaq2Pe/QyT86S1E44bPT99lyfacl4 lNlfAvUoS8lvp5uOzTSyw440l3Eavwg6BK6iULuPIP70AokeZbVSyetRJI9bhH5gEKhd Bs45JIDyaVfEy2wg1VhleITGIJI68ImCn1rJ667v05TXirwondHOKzVpDbIIW0ForUvE ltm/KOEWmCuJTXKxjTrvUbN+MnJ4GmrPKIJ3gCSFHMdF/6KJtliQ02cqPTyPIHpa9lAc YZhe+Sdjo1S8P4XbJOLCfcBj/7IXUQOAiDx7PIFsuPFtBJUZEHf5a8Sw7OvBvrfzAZ/R QJ9Q== X-Forwarded-Encrypted: i=1; AJvYcCWIXL+GK+L0x5T6zmyl1ASEsM4pUVWAUgARbcZnn/Itj+W69lhJYq52xqvLB1MpKDLNo99htqLZbCOehlWcQ6Y=@freebsd.org X-Gm-Message-State: AOJu0YwFjdKDVSZSo2vNwWF34qMQmbQL6YVdm80i9H2asyXQOHXlSJIZ 9HjhfRQ45rhKWKlGs96x+wAn2ag1/u3GeIt6JUAHC8z1EuXuFN/UOlo9Q9az/QTDjKDeO7PaAOD qJ5I4an7OZIwDaST1V4ucze/ujab50Xt9cfPebACMuw== X-Gm-Gg: ASbGnctWlUGgYLcxYzqT3Lgs2fKkLkOlijgNxgrRS/2qnibER726N21hVCJyKo8oLeP 1c3L4ngEZYmaP2e+u7tAL7PKsGPUQMba885LHGtEih+igsDahs7JwJSqCtQzr2yMgBwbR483tpU moCbS35rrq2RI/eEvcANNLjki6YqUfXQIhjyi1tKjpjp90 X-Google-Smtp-Source: AGHT+IEMYd3dpllCUHhz9ria6L2JAddHbzjl+NxGcbKm+Wcol0oNK5YRHyhVLOEWhgBz9JNKJB/kbuIow8Gv9d8H664= X-Received: by 2002:a17:90b:288b:b0:313:27e5:7ff1 with SMTP id 98e67ed59e1d1-313af0fce87mr399420a91.1.1749574486751; Tue, 10 Jun 2025 09:54:46 -0700 (PDT) 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 References: <44DDF236-0911-4CE8-AD30-5E1AB5CB25EB@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Tue, 10 Jun 2025 10:54:34 -0600 X-Gm-Features: AX0GCFsia14ScV9BcJFwvHGMUl6ywrR75lKAVtcTebOzCfNLCwYhlbukanrFVmM Message-ID: Subject: Re: Future of jemalloc on FreeBSD after archive To: Brooks Davis Cc: David Chisnall , Minsoo Choo , FreeBSD CURRENT Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bGvzF2ps0z3mjP 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:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jun 10, 2025 at 6:53=E2=80=AFAM Brooks Davis w= rote: > > On Tue, Jun 10, 2025 at 08:15:02AM +0100, David Chisnall wrote: > > On 10 Jun 2025, at 00:17, Warner Losh 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 bel= ieve 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