mirror of
https://github.com/rclone/rclone.git
synced 2026-03-26 03:12:36 -04:00
Remove the POSIX_FADV_DONTNEED and POSIX_FADV_SEQUENTIAL calls from the local backend. The DONTNEED calls cause severe spinlock contention on parallel file systems (and any system with many concurrent transfers), because each call triggers per-page cache teardown under a global lock. Observed on a 256-core system running rclone with 64 parallel transfers over Lustre: 69% of all CPU cycles were spent in kernel spinlock contention from the fadvise path, with effective throughput well below hardware capability. The kernel's own page reclaim (kswapd) handles eviction more efficiently from a single context. Since rclone does not always read files sequentially (e.g. multipart uploads rewind and re-read blocks), FADV_SEQUENTIAL was also not reliably correct. This is consistent with the non-Linux behavior (which never called fadvise) and with restic's decision to remove identical code (restic/restic#670). Fixes #7886