From nobody Sat Aug 13 03:49:22 2022 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 4M4RPH1ksfz4Z1nV; Sat, 13 Aug 2022 03:49:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M4RPH14b5z3hl4; Sat, 13 Aug 2022 03:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660362563; 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=3Engc/cpcL9EWinVhTpsnlN0MyQQp+rmZi7T6YDfBpI=; b=QPGS78op/AksWlfmTpQZKEdGPoM2BZZOuN9Z8qua2kfY3hdImHQRQ8D80UpW9bqIUrBWTK Cn7aDvCzM6DHqbgOgOIDsWB/ZLdIV8vehQFawvQ/1Y+t8xMwvGl+4Bct65l/xVomCNGevi wceyAxJnkDzxwu8v/qxNni66vHl8qysU+kpgRKkaAPuPGX8uBotIlUv70D5Lsp8zD6hFET MSsZXbO+K0HkOAPHg5m+zY6DRG2iqFIygLVsIX6IxIsyDOTsR0wWttovLxz78UOT7mwYP0 Uxjgd7xWnhdDvH6oZ+u/ti5uZosvaYQkHDuFQd88NicsuWKubCp2AokQloLQaA== 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 4M4RPH03KWzwf1; Sat, 13 Aug 2022 03:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27D3nMoN032781; Sat, 13 Aug 2022 03:49:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27D3nMBx032780; Sat, 13 Aug 2022 03:49:22 GMT (envelope-from git) Date: Sat, 13 Aug 2022 03:49:22 GMT Message-Id: <202208130349.27D3nMBx032780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4f0c9b76cf75 - main - stand: Only compile decompression routines 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f0c9b76cf75724ef0b9c59bb8c182be24361d7c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660362563; 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=3Engc/cpcL9EWinVhTpsnlN0MyQQp+rmZi7T6YDfBpI=; b=GO78PoqLddvSJtNZUXgFdkrm+2KrmVD/yacTZ57N/+UbwaJDGOpWsXSItEc4j9mfdq205f JjdI1JyLhQtmuz1j3RkWVdRxZTO+2LAJNw0Uo1LZ8RaiFAEYT1YIj6rtwyPV5RIv5bdh4X nXm6+dKxadPt/RgF+XzGWTpbhHmsPyRmzEqk7XM8PvBMEHbYSKD/higOUgIibvgZ0q65IY J4YNRzv29A66IWG6BEFakhgSkr0zcEXePyz3Z/W9YvmuvHFvb3HEi+0BPFtOSBKLDpqtmY xYAhwat3C4XYFS1OYUEdSAfeHfFGuDwFXJn6kZNZZgSOMInxdrlgTfeDCZDUEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660362563; a=rsa-sha256; cv=none; b=bLgz/E223fAZKFvlHU4yvAsaDa9cCQarVEY9ir8VHzY6xBQBMNaA4lfsmmU/OOTDiGiFSK iOl0MKCZLRbmVhH0GI7XC8PPYsUEpPWEnjiwZtIglBj91qwkswyQajvYFMZ+P7XYeGyXqk 1ZPb/E8iQk4qk8udZICvWzOXF0qMppEAKgEczrJAYAthr5/ZCPKOh3dhMEOdjaJCT2Lya9 6s+WIqBSWqwdfZHDlK3nN2e7GH0FTcUhSQ2xCtrZWAgj3k4yUsbGj9jWqbX+sSVIqL5nut ZUOSSC1dCCx1SAK4/3p8EgImvkIb43xWDWOOlLk0dvg4a8Gl5qrV2Y92u3yI/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f0c9b76cf75724ef0b9c59bb8c182be24361d7c commit 4f0c9b76cf75724ef0b9c59bb8c182be24361d7c Author: Warner Losh AuthorDate: 2022-08-13 03:30:24 +0000 Commit: Warner Losh CommitDate: 2022-08-13 03:48:18 +0000 stand: Only compile decompression routines We don't need the compress rotuines, nor zstd_opt.c. Remove them. Expand the number of places we omit code for IN_LIBSA (which are FreeBSD specific). Due to the agressive optimization, though, this doesn't reduce the size of the loader. It does reduce the number of 'false positives' for places to omit to reduce the size as well as reducing the build time slightly. Sponsored by: Netflix Reviewed by: tsoome, delphij Differential Revision: https://reviews.freebsd.org/D36145 --- stand/libsa/zfs/Makefile.inc | 8 +++----- sys/contrib/openzfs/module/zstd/zfs_zstd.c | 8 +++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/stand/libsa/zfs/Makefile.inc b/stand/libsa/zfs/Makefile.inc index b168451e24d0..dfd136a02a48 100644 --- a/stand/libsa/zfs/Makefile.inc +++ b/stand/libsa/zfs/Makefile.inc @@ -12,13 +12,11 @@ ZFS_SRC= zfs.c nvlist.c skein.c skein_block.c list.c ZFS_SRC+= zfs_zstd.c ZFS_SRC+= blake3.c blake3_generic.c blake3_impl_hack.c ZSTD_SRC+= entropy_common.c error_private.c -ZSTD_SRC+= fse_compress.c fse_decompress.c hist.c -ZSTD_SRC+= huf_compress.c huf_decompress.c pool.c xxhash.c -ZSTD_SRC+= zstd_common.c zstd_compress.c zstd_compress_literals.c -ZSTD_SRC+= zstd_compress_sequences.c zstd_compress_superblock.c +ZSTD_SRC+= fse_decompress.c hist.c +ZSTD_SRC+= huf_decompress.c pool.c xxhash.c +ZSTD_SRC+= zstd_common.c ZSTD_SRC+= zstd_ddict.c zstd_decompress.c zstd_decompress_block.c ZSTD_SRC+= zstd_double_fast.c zstd_fast.c zstd_lazy.c zstd_ldm.c -ZSTD_SRC+= zstd_opt.c SRCS+= ${ZFS_SRC} ${ZSTD_SRC} diff --git a/sys/contrib/openzfs/module/zstd/zfs_zstd.c b/sys/contrib/openzfs/module/zstd/zfs_zstd.c index d7977dfa6b40..48b41ff7532c 100644 --- a/sys/contrib/openzfs/module/zstd/zfs_zstd.c +++ b/sys/contrib/openzfs/module/zstd/zfs_zstd.c @@ -182,16 +182,20 @@ struct zstd_levelmap { * * The ZSTD handlers were split up for the most simplified implementation. */ +#ifndef IN_LIBSA static void *zstd_alloc(void *opaque, size_t size); +#endif static void *zstd_dctx_alloc(void *opaque, size_t size); static void zstd_free(void *opaque, void *ptr); +#ifndef IN_LIBSA /* Compression memory handler */ static const ZSTD_customMem zstd_malloc = { zstd_alloc, zstd_free, NULL, }; +#endif /* Decompression memory handler */ static const ZSTD_customMem zstd_dctx_malloc = { @@ -489,7 +493,6 @@ keep_trying: return (zfs_zstd_compress(s_start, d_start, s_len, d_len, level)); } -#endif /* Compress block using zstd */ size_t @@ -596,6 +599,7 @@ zfs_zstd_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, return (c_len + sizeof (*hdr)); } +#endif /* Decompress block using zstd and return its stored level */ int @@ -683,6 +687,7 @@ zfs_zstd_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, NULL)); } +#ifndef IN_LIBSA /* Allocator for zstd compression context using mempool_allocator */ static void * zstd_alloc(void *opaque __maybe_unused, size_t size) @@ -699,6 +704,7 @@ zstd_alloc(void *opaque __maybe_unused, size_t size) return ((void*)z + (sizeof (struct zstd_kmem))); } +#endif /* * Allocator for zstd decompression context using mempool_allocator with