tools/power turbostat: Increase the limit for fd opened
authorWyes Karny <wyes.karny@amd.com>
Tue, 3 Oct 2023 05:07:51 +0000 (05:07 +0000)
committerLen Brown <len.brown@intel.com>
Fri, 12 Jan 2024 18:43:19 +0000 (12:43 -0600)
commit3ac1d14d0583a2de75d49a5234d767e2590384dd
tree11977e4bb1792bd27592814abc5092f68a2145a4
parente5f4e68eed85fa8495d78cd966eecc2b27bb9e53
tools/power turbostat: Increase the limit for fd opened

When running turbostat, a system with 512 cpus reaches the limit for
maximum number of file descriptors that can be opened. To solve this
problem, the limit is raised to 2^15, which is a large enough number.

Below data is collected from AMD server systems while running turbostat:

|-----------+-------------------------------|
| # of cpus | # of opened fds for turbostat |
|-----------+-------------------------------|
| 128       | 260                           |
|-----------+-------------------------------|
| 192       | 388                           |
|-----------+-------------------------------|
| 512       | 1028                          |
|-----------+-------------------------------|

So, the new max limit would be sufficient up to 2^14 cpus (but this
also depends on how many counters are enabled).

Reviewed-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Wyes Karny <wyes.karny@amd.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c