Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory: enable tcmalloc for aarch64 #13830

Merged
merged 7 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`


Expand Down
8 changes: 8 additions & 0 deletions bazel/envoy_internal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down Expand Up @@ -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"),
})

Expand Down
4 changes: 4 additions & 0 deletions bazel/envoy_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")],
})

Expand Down
12 changes: 6 additions & 6 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <envoy_api_field_config.filter.http.ext_authz.v2.ExtAuthz.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 <envoy_v3_api_msg_watchdog.v3alpha.AbortActionConfig>` 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
Expand Down