)]}'
{
  "commit": "1c850ca80dc53ffa2bfadabbacda231c941dee76",
  "tree": "3acb857db22435fc4bd00f3188ae2c93f1610f54",
  "parents": [
    "178e197078e105ba4fc1b40a0bb6d7384098128e"
  ],
  "author": {
    "name": "Lancelot Six",
    "email": "lancelot.six@amd.com",
    "time": "Thu Jul 20 10:15:50 2023 +0000"
  },
  "committer": {
    "name": "Lancelot SIX",
    "email": "lancelot.six@amd.com",
    "time": "Fri Jul 21 09:21:07 2023 +0100"
  },
  "message": "gdb/solib-rocm: limit the number of opened file descriptors\n\nROCm programs can load a high number of compute kernels on GPU devices,\nespecially if lazy code-object loading have been disabled.  Each code\nobject containing such program is loaded once for each device available,\nand each instance is reported by GDB as an individual shared library.\n\nWe came across situations where the number of shared libraries opened by\nGDB gets higher than the allowed number of opened files for the process.\nIncreasing the opened files limit works around the problem, but there is a\nbetter way this patch proposes to follow.\n\nUnder the hood, the GPU code objects are embedded inside the host\napplication binary and shared library binaries.  GDB currently opens the\nunderlying file once for each shared library it sees.  That means that\nthe same file is re-opened every time a code object is loaded on a GPU.\n\nThis patch proposes to only open each underlying file once.  This is\ndone by implementing a reference counting mechanism so the underlying\nfile is opened when the underlying file first needs to be opened, and\nclosed when the last BFD using the underlying file is closed.\n\nOn a program where GDB used to open about 1500 files to load all shared\nlibraries, this patch makes it so only 54 opened file descriptors are\nneeded.\n\nI have tested this patch on downstream ROCgdb\u0027s full testsuite and\nupstream GDB testsuite with no regression.\n\nApproved-By: Pedro Alves \u003cpedro@palves.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0ea3702e9e3e06270bcfcee114766659e7ce2ec7",
      "old_mode": 33188,
      "old_path": "gdb/solib-rocm.c",
      "new_id": "882920a3711f6d766096c40daf2c86a0b62f9239",
      "new_mode": 33188,
      "new_path": "gdb/solib-rocm.c"
    }
  ]
}
