From nobody Tue Oct 15 15:07:09 2024 X-Original-To: dev-commits-src-all@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 4XScrs6p5dz5YYhr; Tue, 15 Oct 2024 15:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XScrs6JJJz4Dwf; Tue, 15 Oct 2024 15:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SKDzS7Kbi2AAJx+V8l2v8+1VnMleOsKSbM+bgkfGrQs=; b=NC3Q6rxVrBWcuXujAQlEPzPujnR+XyOpHiENeh0aLmk8iBeRuxGht0YBAqQDs8AqhmmaJo s74qtfOWYD+SKmkzZ9nS5BSMVHM9tKJi0s8DYJNEDbdIayzJGEu15Xtx4Q/yQkssO4aqMX nVG+BYjK6HgLA8prV2FQBQ9kxX1IUUz+tba1wU9g0H2ScEDuiVclAtr8dq0vHMIWsr4FuN Xf6RFlObHnQp4gi3DTMCRsN6VYN9vN5JRbV6P8zpVdX6kzBzjCMhRcq1638YWvZNMOKISY NIuREI6rhF7cifLIPmD7IUOxKLIo7ZJHphvAHjhmO51hmw2Dezk3RWn/Ml7t7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SKDzS7Kbi2AAJx+V8l2v8+1VnMleOsKSbM+bgkfGrQs=; b=JRS8hxnEHdITWWYk8+zYWtO1JE9T7fPmqNa5265mi8ovQBpr8yl2wm2W9rILfgHIntD42u h6WR/RTRJbUyCQIjFlSf6blIy8rmLdxqyAiAtqB/3hDKcAAIca2MIBr3+OcsTwYat0bIPq g/tPTRP7QZQ/I2pI1woTPWYBTdmwRdTZ4HZwXDM/L19oECTmI8p+7Zi5d88Gd4laJoP56S /ijWz4ZPWbDM6Pv3Ptx1SxK0HqC+JsN6GDiXuKj2l/8qzvxxRCipX5ouTrz47R0mBQdBDF tjcgwGX1BvATDtmrSKzj4TLeLE//Vnu9RfCZiv4cV+z65tzytWe20uVbl0yv0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729004829; a=rsa-sha256; cv=none; b=ozxWKGIMrdQUjulgSJA5+U9xJIKsbp+Scsgwyy3nnh4ie9OOLKTw1WTXG1QK2fPUVWH+cm Qlo2x7I422yeaf821IhI4c2+or9OJXmm5om+BY38GwYOAn/o426Svpzb0RCPVyg4+qGAGo 7ykfiHLMtIWKl1qUOoiWrqeWvbhEHDv2QtAKb19J00DJLCu0XsGmFumspfjylaf1urnmFI 4S/FPGuD3eNKeQKGrSucr8Pj14abGK8Brljyp/v2SJa0sgn9mMg2Y+aUVB5vyXZVH5ex+p QZjAZY8Q/E0hnKJrp6GaIwWtCY6K1v87ydi/JyLCBplpkLRkMlWXbETJ1QWgGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XScrs5jJGzRhn; Tue, 15 Oct 2024 15:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49FF79KK090441; Tue, 15 Oct 2024 15:07:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FF790k090438; Tue, 15 Oct 2024 15:07:09 GMT (envelope-from git) Date: Tue, 15 Oct 2024 15:07:09 GMT Message-Id: <202410151507.49FF790k090438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b90d68c9b28b - stable/14 - jemalloc: set LG_VADDR to 64 on amd64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b90d68c9b28b0a458bdf4a963397817974ed0f90 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b90d68c9b28b0a458bdf4a963397817974ed0f90 commit b90d68c9b28b0a458bdf4a963397817974ed0f90 Author: Konstantin Belousov AuthorDate: 2024-09-16 21:09:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-15 15:06:44 +0000 jemalloc: set LG_VADDR to 64 on amd64 (cherry picked from commit eade2001aa9d91440886de8359a4dec9edcde2a9) --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h | 4 ++++ lib/libc/stdlib/malloc/jemalloc/Makefile.inc | 3 +++ share/mk/src.opts.mk | 1 + tools/build/options/WITHOUT_JEMALLOC_LG_VADDR_WIDE | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h index ea8e8d42b14e..493300157a70 100644 --- a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h +++ b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h @@ -39,7 +39,11 @@ # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __amd64__ +#ifdef _USE_LG_VADDR_WIDE +# define LG_VADDR 64 +#else # define LG_VADDR 48 +#endif # define LG_SIZEOF_PTR 3 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif diff --git a/lib/libc/stdlib/malloc/jemalloc/Makefile.inc b/lib/libc/stdlib/malloc/jemalloc/Makefile.inc index 1ba7725fe8a8..d916d69f471f 100644 --- a/lib/libc/stdlib/malloc/jemalloc/Makefile.inc +++ b/lib/libc/stdlib/malloc/jemalloc/Makefile.inc @@ -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 CFLAGS+=-I${SRCTOP}/contrib/jemalloc/include +.if ${MK_JEMALLOC_LG_VADDR_WIDE} != no +CFLAGS+=-D_USE_LG_VADDR_WIDE +.endif .for src in ${JEMALLOCSRCS} MISRCS+=jemalloc_${src} diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 600daa9ef61b..774b6fffd3df 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -118,6 +118,7 @@ __DEFAULT_YES_OPTIONS = \ IPFW \ ISCSI \ JAIL \ + JEMALLOC_LG_VADDR_WIDE \ KDUMP \ KVM \ LDNS \ diff --git a/tools/build/options/WITHOUT_JEMALLOC_LG_VADDR_WIDE b/tools/build/options/WITHOUT_JEMALLOC_LG_VADDR_WIDE new file mode 100644 index 000000000000..9efc4022e9cf --- /dev/null +++ b/tools/build/options/WITHOUT_JEMALLOC_LG_VADDR_WIDE @@ -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).