Urgent.News

What's breaking now, across thousands of outlets.

Tech

Linux 7.4 To Close Files Synchronously For close_range, exec & exit

Of the many VFS changes to be merged for Linux 7.4 is now closing files synchrously for close_range, exec, and exit calls. In turn when needing to close many file descriptors this provides for much lower latency than the status quo...

Linux 7.4 will close files synchronously for close_range(), exec, and exit. This change, based on the vfs-7.4-rc1.close_range tag, adds a task work queue to handle the final __fput() of an exiting task. The process involves a cmpxchg() and a TIF_NOTIFY_RESUME test-and-set per file, plus a search under pi_lock for any subsequent task_work_cancel(). Additionally, close_files(), close_range(), and close-on-exec now flush and put each file inline, similar to the behavior of the close(2) system call.

The modification offers performance improvements, reducing the time to close files with 16-21% or 40-150 ns per closed file, with the largest impact occurring when a task has 1M descriptors. Even with eight processes terminating 65,536 descriptors simultaneously, the difference remains at 16-21%. However, when 32 or 64 processes are involved, the kernels become bound by pushing millions of files through slab and rcu, resulting in a reduced difference of only 4-8%.

Certain file types, such as eventfds, pipes, and AF_UNIX sockets, experience a smaller gain of 13%, 11%, and 6% respectively. The close(2) system call remains unaffected, and the performance improvement is within 2%. Michael Larabel, the principal author of Phoronix.com, is the lead developer behind the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software.

Written by urgent.news from Phoronix's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at phoronix.com →

More in Tech

Waiting for a passport? Glitch delays passport issuance

First report: The waiting time for a biometric passport has jumped from six weeks to about two months due to a malfunction in a Population and Immigration Authority machine.

  • Israeli passport issuance delayed by 8 weeks due to technical glitch
  • Appointment slots scarce, forcing long-distance travel for urgent needs
  • Biometric machine malfunction unresolved, adding to the backlog

More from Wednesday 21 October →