diff --git a/bazel/BUILD b/bazel/BUILD index d03b931018a3..10ca8a27bca1 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -188,7 +188,7 @@ config_setting( ) # As select() can't be nested we need these specialized settings to avoid ambiguity when choosing -# tcmalloc's flavor for x86_64 builds. +# tcmalloc's flavor for x86_64 and aarch64 builds. config_setting( name = "disable_tcmalloc_on_linux_x86_64", values = { @@ -213,6 +213,30 @@ config_setting( }, ) +config_setting( + name = "disable_tcmalloc_on_linux_aarch64", + values = { + "define": "tcmalloc=disabled", + "cpu": "aarch64", + }, +) + +config_setting( + name = "gperftools_tcmalloc_on_linux_aarch64", + values = { + "define": "tcmalloc=gperftools", + "cpu": "aarch64", + }, +) + +config_setting( + name = "debug_tcmalloc_on_linux_aarch64", + values = { + "define": "tcmalloc=debug", + "cpu": "aarch64", + }, +) + config_setting( name = "disable_signal_trace", values = {"define": "signal_trace=disabled"}, diff --git a/bazel/README.md b/bazel/README.md index 024e4b88b49d..31fd073256bd 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -615,7 +615,7 @@ The following optional features can be disabled on the Bazel build command-line: * Backtracing on signals with `--define signal_trace=disabled` * Active stream state dump on signals with `--define signal_trace=disabled` or `--define disable_object_dump_on_signal_trace=disabled` * tcmalloc with `--define tcmalloc=disabled`. Also you can choose Gperftools' implementation of - tcmalloc with `--define tcmalloc=gperftools` which is the default for non-x86 builds. + tcmalloc with `--define tcmalloc=gperftools` which is the default for builds other than x86_64 and aarch64. * deprecated features with `--define deprecated_features=disabled` diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 4e4694f03cdd..91d7ac2abee8 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -70,11 +70,15 @@ def envoy_copts(repository, test = False): }) + select({ repository + "//bazel:disable_tcmalloc": ["-DABSL_MALLOC_HOOK_MMAP_DISABLE"], repository + "//bazel:disable_tcmalloc_on_linux_x86_64": ["-DABSL_MALLOC_HOOK_MMAP_DISABLE"], + repository + "//bazel:disable_tcmalloc_on_linux_aarch64": ["-DABSL_MALLOC_HOOK_MMAP_DISABLE"], repository + "//bazel:gperftools_tcmalloc": ["-DGPERFTOOLS_TCMALLOC"], repository + "//bazel:gperftools_tcmalloc_on_linux_x86_64": ["-DGPERFTOOLS_TCMALLOC"], + repository + "//bazel:gperftools_tcmalloc_on_linux_aarch64": ["-DGPERFTOOLS_TCMALLOC"], repository + "//bazel:debug_tcmalloc": ["-DENVOY_MEMORY_DEBUG_ENABLED=1", "-DGPERFTOOLS_TCMALLOC"], repository + "//bazel:debug_tcmalloc_on_linux_x86_64": ["-DENVOY_MEMORY_DEBUG_ENABLED=1", "-DGPERFTOOLS_TCMALLOC"], + repository + "//bazel:debug_tcmalloc_on_linux_aarch64": ["-DENVOY_MEMORY_DEBUG_ENABLED=1", "-DGPERFTOOLS_TCMALLOC"], repository + "//bazel:linux_x86_64": ["-DTCMALLOC"], + repository + "//bazel:linux_aarch64": ["-DTCMALLOC"], "//conditions:default": ["-DGPERFTOOLS_TCMALLOC"], }) + select({ repository + "//bazel:disable_signal_trace": [], @@ -131,11 +135,15 @@ def tcmalloc_external_dep(repository): return select({ repository + "//bazel:disable_tcmalloc": None, repository + "//bazel:disable_tcmalloc_on_linux_x86_64": None, + repository + "//bazel:disable_tcmalloc_on_linux_aarch64": None, repository + "//bazel:debug_tcmalloc": envoy_external_dep_path("gperftools"), repository + "//bazel:debug_tcmalloc_on_linux_x86_64": envoy_external_dep_path("gperftools"), + repository + "//bazel:debug_tcmalloc_on_linux_aarch64": envoy_external_dep_path("gperftools"), repository + "//bazel:gperftools_tcmalloc": envoy_external_dep_path("gperftools"), repository + "//bazel:gperftools_tcmalloc_on_linux_x86_64": envoy_external_dep_path("gperftools"), + repository + "//bazel:gperftools_tcmalloc_on_linux_aarch64": envoy_external_dep_path("gperftools"), repository + "//bazel:linux_x86_64": envoy_external_dep_path("tcmalloc"), + repository + "//bazel:linux_aarch64": envoy_external_dep_path("tcmalloc"), "//conditions:default": envoy_external_dep_path("gperftools"), }) diff --git a/bazel/envoy_library.bzl b/bazel/envoy_library.bzl index 5eb90df500c0..adcee0750790 100644 --- a/bazel/envoy_library.bzl +++ b/bazel/envoy_library.bzl @@ -21,11 +21,15 @@ def tcmalloc_external_deps(repository): return select({ repository + "//bazel:disable_tcmalloc": [], repository + "//bazel:disable_tcmalloc_on_linux_x86_64": [], + repository + "//bazel:disable_tcmalloc_on_linux_aarch64": [], repository + "//bazel:debug_tcmalloc": [envoy_external_dep_path("gperftools")], repository + "//bazel:debug_tcmalloc_on_linux_x86_64": [envoy_external_dep_path("gperftools")], + repository + "//bazel:debug_tcmalloc_on_linux_aarch64": [envoy_external_dep_path("gperftools")], repository + "//bazel:gperftools_tcmalloc": [envoy_external_dep_path("gperftools")], repository + "//bazel:gperftools_tcmalloc_on_linux_x86_64": [envoy_external_dep_path("gperftools")], + repository + "//bazel:gperftools_tcmalloc_on_linux_aarch64": [envoy_external_dep_path("gperftools")], repository + "//bazel:linux_x86_64": [envoy_external_dep_path("tcmalloc")], + repository + "//bazel:linux_aarch64": [envoy_external_dep_path("tcmalloc")], "//conditions:default": [envoy_external_dep_path("gperftools")], }) diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 974c9deea62b..2ba871e1ef11 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -89,12 +89,12 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "Abseil", project_desc = "Open source collection of C++ libraries drawn from the most fundamental pieces of Google’s internal codebase", project_url = "https://abseil.io/", - version = "093cc27604df1c4a179b73bc3f00d4d1ce2ce113", - sha256 = "55d33c75aff05a8c4a55bdf0eddad66c71a963107bc2add96cf8eb88ddb47a80", + version = "8f1c34a77a2ba04512b7f9cbc6013d405e6a0b31", + sha256 = "635367c5cac4bbab95d0485ba9e68fa422546b06ce050190c99be7e23aba3ce3", strip_prefix = "abseil-cpp-{version}", urls = ["https://github.com/abseil/abseil-cpp/archive/{version}.tar.gz"], use_category = ["dataplane_core", "controlplane"], - release_date = "2020-10-01", + release_date = "2020-10-17", cpe = "N/A", ), com_github_c_ares_c_ares = dict( @@ -199,12 +199,12 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "tcmalloc", project_desc = "Fast, multi-threaded malloc implementation", project_url = "https://github.com/google/tcmalloc", - version = "d1311bf409db47c3441d3de6ea07d768c6551dec", - sha256 = "e22444b6544edd81f11c987dd5e482a2e00bbff717badb388779ca57525dad50", + version = "9f385356c34d4fc11f76a000b609e2b446c20667", + sha256 = "652e48e0b9ef645db04bff8a3d4841c60ce07275f5d98e18e698dc92bd111291", strip_prefix = "tcmalloc-{version}", urls = ["https://github.com/google/tcmalloc/archive/{version}.tar.gz"], use_category = ["dataplane_core", "controlplane"], - release_date = "2020-09-16", + release_date = "2020-11-04", cpe = "N/A", ), com_github_gperftools_gperftools = dict( diff --git a/docs/root/version_history/current.rst b/docs/root/version_history/current.rst index 041ea6adaeac..45bb26163b55 100644 --- a/docs/root/version_history/current.rst +++ b/docs/root/version_history/current.rst @@ -15,6 +15,7 @@ Minor Behavior Changes * ext_authz filter: disable `envoy.reloadable_features.ext_authz_measure_timeout_on_check_created` by default. * ext_authz filter: the deprecated field :ref:`use_alpha ` is no longer supported and cannot be set anymore. * grpc_web filter: if a `grpc-accept-encoding` header is present it's passed as-is to the upstream and if it isn't `grpc-accept-encoding:identity` is sent instead. The header was always overwriten with `grpc-accept-encoding:identity,deflate,gzip` before. +* memory: enable new tcmalloc with restartable sequences for aarch64 builds. * tls: removed RSA key transport and SHA-1 cipher suites from the client-side defaults. * watchdog: the watchdog action :ref:`abort_action ` is now the default action to terminate the process if watchdog kill / multikill is enabled. * xds: to support TTLs, heartbeating has been added to xDS. As a result, responses that contain empty resources without updating the version will no longer be propagated to the