diff options
author | Christian Brauner <brauner@kernel.org> | 2024-10-08 13:05:18 +0200 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-10-30 09:58:02 +0100 |
commit | 62eec753cae265002043872ba419d0887fe33ec6 (patch) | |
tree | a0b6604acca7446936589359cc5c70828b9b50a4 /lib/crypto/mpi/mpi-mul.c | |
parent | 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b (diff) | |
parent | 90ee6ed776c06435a3fe79c7f5344761f52e1760 (diff) | |
download | linux-62eec753cae265002043872ba419d0887fe33ec6.tar.gz linux-62eec753cae265002043872ba419d0887fe33ec6.tar.bz2 linux-62eec753cae265002043872ba419d0887fe33ec6.zip |
Merge patch series "fs: introduce file_ref_t"
Christian Brauner <brauner@kernel.org> says:
As atomic_inc_not_zero() is implemented with a try_cmpxchg() loop it has
O(N^2) behaviour under contention with N concurrent operations and it is
in a hot path in __fget_files_rcu().
The rcuref infrastructures remedies this problem by using an
unconditional increment relying on safe- and dead zones to make this
work and requiring rcu protection for the data structure in question.
This not just scales better it also introduces overflow protection.
However, in contrast to generic rcuref, files require a memory barrier
and thus cannot rely on *_relaxed() atomic operations and also require
to be built on atomic_long_t as having massive amounts of reference
isn't unheard of even if it is just an attack.
As suggested by Linus, add a file specific variant instead of making
this a generic library.
I've been testing this with will-it-scale using a multi-threaded fstat()
on the same file descriptor on a machine that Jens gave me access (thank
you very much!):
processor : 511
vendor_id : AuthenticAMD
cpu family : 25
model : 160
model name : AMD EPYC 9754 128-Core Processor
and I consistently get a 3-5% improvement on workloads with 256+ and
more threads comparing v6.12-rc1 as base with and without these patches
applied.
* patches from https://lore.kernel.org/r/20241007-brauner-file-rcuref-v2-0-387e24dc9163@kernel.org:
fs: port files to file_ref
fs: add file_ref
fs: protect backing files with rcu
Link: https://lore.kernel.org/r/20241007-brauner-file-rcuref-v2-0-387e24dc9163@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'lib/crypto/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions