Re: [PATCH] efivarfs: avoid slow QueryVariableInfo() in statfs()

From: Ard Biesheuvel

Date: Thu Sep 17 2026 - 04:57:55 EST


Hello Prashant,

On Thu, 17 Sep 2026, at 09:16, Prashant Singh wrote:
> QueryVariableInfo() is an EFI runtime service that, on some platforms,
> takes tens of milliseconds and runs with preemption disabled, freezing
> the CPU that services it for the whole call. efivarfs_statfs() issued
> this call on every statfs(2) (e.g. every "df"), which produced large
> latency spikes for unrelated latency-sensitive workloads pinned to the
> same CPU.
>
> Commit b2326338dc68 ("efivarfs: Rate limit statfs() handler") already
> bounds the firmware call to twice per second. That helps against a
> statfs() flood, but on a real-time / dataplane system even the residual
> 2 calls/s x ~40ms = up to ~80ms/s of preempt-disabled CPU time is
> unacceptable: any unprivileged process (or a periodic monitoring "df")
> can still inject ~40ms stalls into a co-located latency-sensitive task.
>

Could we instead introduce a mount option that disables used/available
reporting entirely? Feel free to set the default to 'disabled' when
CONFIG_PREEMPT_RT is set.