)]}'
{
  "commit": "e6dacf91ffb0a356aa692ab5c46411e2eef913f3",
  "tree": "fc337b1d3fe594503468a6af639ed6459442ee2a",
  "parents": [
    "f12c66fbed546645389cf184b0e2ffd6ad9f78ec"
  ],
  "author": {
    "name": "Michael Pratt",
    "email": "mpratt@google.com",
    "time": "Mon May 05 13:44:26 2025 -0400"
  },
  "committer": {
    "name": "Michael Pratt",
    "email": "mpratt@google.com",
    "time": "Wed May 21 10:21:55 2025 -0700"
  },
  "message": "runtime: use cgroup CPU limit to set GOMAXPROCS\n\nThis CL adds two related features enabled by default via compatibility\nGODEBUGs containermaxprocs and updatemaxprocs.\n\nOn Linux, containermaxprocs makes the Go runtime consider cgroup CPU\nbandwidth limits (quota/period) when setting GOMAXPROCS. If the cgroup\nlimit is lower than the number of logical CPUs available, then the\ncgroup limit takes precedence.\n\nOn all OSes, updatemaxprocs makes the Go runtime periodically\nrecalculate the default GOMAXPROCS value and update GOMAXPROCS if it has\nchanged. If GOMAXPROCS is set manually, this update does not occur. This\nis intended primarily to detect changes to cgroup limits, but it applies\non all OSes because the CPU affinity mask can change as well.\n\nThe runtime only considers the limit in the leaf cgroup (the one that\nactually contains the process), caching the CPU limit file\ndescriptor(s), which are periodically reread for updates. This is a\nsmall departure from the original proposed design. It will not consider\nlimits of parent cgroups (which may be lower than the leaf), and it will\nnot detection cgroup migration after process start.\n\nWe can consider changing this in the future, but the simpler approach is\nless invasive; less risk to packages that have some awareness of runtime\ninternals. e.g., if the runtime periodically opens new files during\nexecution, file descriptor leak detection is difficult to implement in a\nstable way.\n\nFor #73193.\n\nCq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest\nChange-Id: I6a6a636c631c1ae577fb8254960377ba91c5dc98\nReviewed-on: https://go-review.googlesource.com/c/go/+/670497\nLUCI-TryBot-Result: Go LUCI \u003cgolang-scoped@luci-project-accounts.iam.gserviceaccount.com\u003e\nReviewed-by: Michael Knyszek \u003cmknyszek@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f2b6ea748cdfc92f05f40d7131e70cfdc6833b4d",
      "new_mode": 33188,
      "new_path": "api/next/73193.txt"
    },
    {
      "type": "modify",
      "old_id": "1d6e6d78d07759e41278fec0d0650d6b72d93037",
      "old_mode": 33188,
      "old_path": "doc/godebug.md",
      "new_id": "b0c820da465b98a5467d0e83943526f0b607d410",
      "new_mode": 33188,
      "new_path": "doc/godebug.md"
    },
    {
      "type": "modify",
      "old_id": "4e8182c8cf8939d91b67a807ee72a3ca091715cd",
      "old_mode": 33188,
      "old_path": "doc/next/4-runtime.md",
      "new_id": "67c1cee401a7e69b58f56657174e7d92afa231a7",
      "new_mode": 33188,
      "new_path": "doc/next/4-runtime.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a729f6a3c468805b9a106af3b5d0a695f6cb1863",
      "new_mode": 33188,
      "new_path": "doc/next/6-stdlib/99-minor/runtime/73193.md"
    },
    {
      "type": "modify",
      "old_id": "6fee3b6679579c7b5c61c6d4a19f7d9ab75fd0f4",
      "old_mode": 33188,
      "old_path": "src/go/build/deps_test.go",
      "new_id": "e4fcc766b7c3839d499829476b7478c24961630d",
      "new_mode": 33188,
      "new_path": "src/go/build/deps_test.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f23c37a705b56c1f6d9f9b76be2e775fb1dd1545",
      "new_mode": 33188,
      "new_path": "src/internal/cgrouptest/cgrouptest_linux.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f3a4a133e81825d7dfaea5cb249abd436c00e36b",
      "new_mode": 33188,
      "new_path": "src/internal/cgrouptest/cgrouptest_linux_test.go"
    },
    {
      "type": "modify",
      "old_id": "f68523a348833b207dfde138fb5c1fe325dc341f",
      "old_mode": 33188,
      "old_path": "src/internal/coverage/pkid.go",
      "new_id": "30b5ad49aceac2bbc1079daeb3c813e74f3e6854",
      "new_mode": 33188,
      "new_path": "src/internal/coverage/pkid.go"
    },
    {
      "type": "modify",
      "old_id": "8ebe221fd3f07a6eead9c9c3e380db763ef5a38b",
      "old_mode": 33188,
      "old_path": "src/internal/godebugs/table.go",
      "new_id": "9262ce23baaba712e88f3e10731573f3e15c39ee",
      "new_mode": 33188,
      "new_path": "src/internal/godebugs/table.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "73e7363eb44632529d5582d3fbbe28bbc1e6a491",
      "new_mode": 33188,
      "new_path": "src/runtime/cgroup_linux.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0b060572b6912bfbe2d029372b29aa2eea98f336",
      "new_mode": 33188,
      "new_path": "src/runtime/cgroup_linux_test.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1f37b1783bd0fd1fc77353e3936f3de9158c5dbd",
      "new_mode": 33188,
      "new_path": "src/runtime/cgroup_stubs.go"
    },
    {
      "type": "modify",
      "old_id": "57e9ba8d7d4b440b93b6742af5bb30a6f39a8a29",
      "old_mode": 33188,
      "old_path": "src/runtime/debug.go",
      "new_id": "94d1dab34d7b33f2a3e4de7482dddf6da59d352a",
      "new_mode": 33188,
      "new_path": "src/runtime/debug.go"
    },
    {
      "type": "modify",
      "old_id": "9f281c404505aef53ea063f6cc5a5a1bc37fcc3c",
      "old_mode": 33188,
      "old_path": "src/runtime/float.go",
      "new_id": "d8573c103b325fca8f33f1719d656b3051a7b076",
      "new_mode": 33188,
      "new_path": "src/runtime/float.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "caa3e0cf8acaec7388c7888828e1dde69c744760",
      "new_mode": 33188,
      "new_path": "src/runtime/gomaxprocs_windows_test.go"
    },
    {
      "type": "modify",
      "old_id": "024fc1ebf406dec90085deb87eb5d4d3fbd85a58",
      "old_mode": 33188,
      "old_path": "src/runtime/lockrank.go",
      "new_id": "456f2b75e6aa87b76cac0026008db300229c5583",
      "new_mode": 33188,
      "new_path": "src/runtime/lockrank.go"
    },
    {
      "type": "modify",
      "old_id": "0d35314e06f109e80981ad525d6585d8b0744055",
      "old_mode": 33188,
      "old_path": "src/runtime/metrics/doc.go",
      "new_id": "8204e87fd161924917da436f4e95dfab4c0e27ba",
      "new_mode": 33188,
      "new_path": "src/runtime/metrics/doc.go"
    },
    {
      "type": "modify",
      "old_id": "dd30541211bac5cd156e3a12032d8e60ac090118",
      "old_mode": 33188,
      "old_path": "src/runtime/mklockrank.go",
      "new_id": "6cccece9b53a0702b13089e710b8e2f9862f75c6",
      "new_mode": 33188,
      "new_path": "src/runtime/mklockrank.go"
    },
    {
      "type": "modify",
      "old_id": "55cb630b5d37e199ac6ff250e08d7d4773946185",
      "old_mode": 33188,
      "old_path": "src/runtime/proc.go",
      "new_id": "492552878397c9e45d4f13fe7d28cb56bfa34c81",
      "new_mode": 33188,
      "new_path": "src/runtime/proc.go"
    },
    {
      "type": "modify",
      "old_id": "3afb6558b03f50a6b246f3a321752d474e5710f0",
      "old_mode": 33188,
      "old_path": "src/runtime/runtime.go",
      "new_id": "016cbdae58ccb60fcb0e641aa773687efd1c6703",
      "new_mode": 33188,
      "new_path": "src/runtime/runtime.go"
    },
    {
      "type": "modify",
      "old_id": "975d4016943582199cc8eea88e06265643bec5a0",
      "old_mode": 33188,
      "old_path": "src/runtime/runtime1.go",
      "new_id": "424745d2357dc97831d4523ec6b580978c216c58",
      "new_mode": 33188,
      "new_path": "src/runtime/runtime1.go"
    },
    {
      "type": "modify",
      "old_id": "65b31f737bbd8d8b24c38663106a2edc74859131",
      "old_mode": 33188,
      "old_path": "src/runtime/runtime2.go",
      "new_id": "94ab87f6db218dd6a611617984d80d1b5b3b94ba",
      "new_mode": 33188,
      "new_path": "src/runtime/runtime2.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "915e3c4dad4e12879f9a4f7d88340448aab5d86a",
      "new_mode": 33188,
      "new_path": "src/runtime/testdata/testprog/gomaxprocs.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "bc7a4b1063087f47afbc5189c1b3759857c78ce9",
      "new_mode": 33188,
      "new_path": "src/runtime/testdata/testprog/gomaxprocs_windows.go"
    }
  ]
}
