intel / intel-cmt-cat

User space software for Intel(R) Resource Director Technology
http://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html
Other
685 stars 180 forks source link

lib/cpuinfo: Increase the file descriptors limit to handle more CPUs #263

Closed babumoger closed 1 month ago

babumoger commented 5 months ago

The pqos tool fails with the following errors on systems with 300 or more CPU cores. $pqos NOTE: Mixed use of MSR and kernel interfaces to manage CAT or CMT & MBM may lead to unexpected behavior. ERROR: Could not open /sys/fs/resctrl directory ERROR: Failed to stop resctrl events ERROR: Failed to start all selected OS monitoring events Monitoring start error on core(s) 339, status 1

By default, the file descriptor limit is set to 1024 for a session. pqos monitor uses 3 descriptors for each CPU for perf monitoring. So, it runs out of limit(1024) on systems with 300 or more CPUs.

Fix the issue by detecting the number of CPUs in the system and increasing the descriptor limit using system call getrlimit and setrlimit respectively. Increase the limit to 4 times the number of CPUs to take care of open files limit.

Description

By default, the file descriptor limit is set to 1024 for a session. pqos monitor uses 3 descriptors for each CPU for perf monitoring. So, it runs out of limit(1024) on systems with 300 or more CPUs.

Fix the issue by detecting the number of CPUs in the system and increasing the descriptor limit using system call getrlimit and setrlimit respectively. Increase the limit to 4 times the number of CPUs to take care of open files limit.

Affected parts

Motivation and Context

https://github.com/intel/intel-cmt-cat/issues/261

How Has This Been Tested?

Types of changes

Checklist:

babumoger commented 4 months ago

Please take a look at the code.

rkanagar commented 4 months ago

Please take a look at the code.

Yes, we are reviewing this code. Thanks

rkanagar commented 3 months ago

Hi Babu, Please implement the attached fd_diff.txt fd_diff.txt

babumoger commented 3 months ago

Hi Babu, Please implement the attached fd_diff.txt fd_diff.txt

Hi Raghavan, I have implemented your changes. Please review. thanks

rkanagar commented 1 month ago

Merged in v24.05 release