# Linux 7.4 to close files synchronously for close_range, exec, and exit

> **Key takeaway:** Linux 7.4 changes close_range(), exec, and exit to close file descriptors synchronously rather than deferring via task work, cutting teardown latency by 16-21% for large descriptor tables.

**Published:** 2026-10-21T11:55:42+00:00 
**Source:** Phoronix Benchmarks &amp; Drivers 
**Category:** kernel-os 
**Canonical URL:** https://fosswire.org/news/linux-74-to-close-files-synchronously-for-closerange-exec-an.html 

## Summary
A VFS change merged for Linux 7.4 makes file descriptor teardown synchronous for close_range(), exec, and exit paths. Previously these operations queued final file puts as deferred task work, causing two passes over the descriptor table and cache thrashing with many FDs. The new behavior matches close(2), with measured improvements of 16-21% for single-process teardown and 4-8% under heavy contention. Kernel threads are unaffected.

## What changes in file teardown
- **Before:** fput() used deferred task work; exit_task_work() ran __fput() for each file with a cmpxchg and TIF_NOTIFY_RESUME test-and-set per FD, plus a second non-cache-hot pass
- **After:** close_files(), close_range(), and close-on-exec now flush and put each file inline, identical to close(2)
- **Benchmarks on 64 vCPU KVM/AMD EPYC:** 16-21% faster (40-150 ns per file) at 1M descriptors; 16-21% with 8 processes × 65536 FDs; 4-8% at 32-64 processes due to slab/RCU saturation
- **Per-file-type variation:** 13% for eventfds, 11% for pipes, 6% for AF_UNIX sockets where release() dominates
- **close(2) unchanged;** will-it-scale within 2%

## Why it matters
Applications and containers that frequently spawn short-lived processes with many open files—common in server workloads and CI/CD pipelines—should see reduced latency at teardown. The change removes a long-standing performance pain point identified by kernel developers Oleg Nesterov and Neil Brown over multiple years.