mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Whenever the file descriptor table is full, Linux expands it by doubling it's size. The filesystem code that does this uses RCU synchronization to ensure all pre-existing RCU read-side critical sections have completed. The latency induced by this synchronization is a big part of the total time required to restore a snapshot. The kernel has an optimization in code, where it doesn't call synchronize_rcu() if there is only one thread in the process. We can take advantage of this optimization by expanding the descriptor table at the application start, when it has only one thread. This commit tries to expand the table to 4096 entries, this way we avoid any expansion that could take place later. Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>