Re: [PATCH v7 5/5] x86/sgx: Enable automatic SVN updates for SGX enclaves
From: Dave Hansen
Date: Mon Jul 14 2025 - 09:55:52 EST
On 7/14/25 00:35, Reshetova, Elena wrote:
> I think you put it: this would require a spinlock in the fast path and
> *in theory* if we are running many many concurrent enclaves can create
> contention
FWIW, my mental model is that spinlocks that are held for short periods
of time are pretty much the same cost as an atomic under contention.
If there are lots of users, the cost of moving the cacheline for the
atomic or the spinlock dominates everything else. It doesn't matter
whether that cacheline is an atomic_t or spinlock_t.
The only difference is that there is _visible_ spinning for a spinlock.