linux/fs/netfs
David Howells d6a77668a7
netfs: Downgrade i_rwsem for a buffered write
In the I/O locking code borrowed from NFS into netfslib, i_rwsem is held
locked across a buffered write - but this causes a performance regression
in cifs as it excludes buffered reads for the duration (cifs didn't use any
locking for buffered reads).

Mitigate this somewhat by downgrading the i_rwsem to a read lock across the
buffered write.  This at least allows parallel reads to occur whilst
excluding other writes, DIO, truncate and setattr.

Note that this shouldn't be a problem for a buffered write as a read
through an mmap can circumvent i_rwsem anyway.

Also note that we might want to make this change in NFS also.

Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/1317958.1729096113@warthog.procyon.org.uk
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.com>
cc: Trond Myklebust <trondmy@kernel.org>
cc: Jeff Layton <jlayton@kernel.org>
cc: netfs@lists.linux.dev
cc: linux-cifs@vger.kernel.org
cc: linux-nfs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-10-17 15:33:42 +02:00
..
buffered_read.c netfs: In readahead, put the folio refs as soon extracted 2024-10-07 13:48:22 +02:00
buffered_write.c netfs, cifs: Fix mtime/ctime update for mmapped writes 2024-09-24 21:57:00 -05:00
direct_read.c netfs: Speed up buffered reading 2024-09-12 12:20:41 +02:00
direct_write.c netfs: Revert "netfs: Switch debug logging to pr_debug()" 2024-07-24 10:15:37 +02:00
fscache_cache.c netfs: Revert "netfs: Switch debug logging to pr_debug()" 2024-07-24 10:15:37 +02:00
fscache_cookie.c fs/netfs/fscache_cookie: add missing "n_accesses" check 2024-08-12 22:03:26 +02:00
fscache_internal.h netfs, fscache: Combine fscache with netfs 2023-12-24 15:08:46 +00:00
fscache_io.c netfs: Revert "netfs: Switch debug logging to pr_debug()" 2024-07-24 10:15:37 +02:00
fscache_main.c fscache: delete fscache_cookie_lru_timer when fscache exits to avoid UAF 2024-09-01 10:30:25 +02:00
fscache_proc.c netfs: Fix proc/fs/fscache symlink to point to "netfs" not "../netfs" 2024-01-04 13:15:32 +00:00
fscache_stats.c netfs: Fix interaction between write-streaming and cachefiles culling 2024-01-05 15:42:25 +00:00
fscache_volume.c netfs: Revert "netfs: Switch debug logging to pr_debug()" 2024-07-24 10:15:37 +02:00
internal.h netfs: Fix write oops in generic/346 (9p) and generic/074 (cifs) 2024-09-26 17:45:20 -05:00
iterator.c netfs: Speed up buffered reading 2024-09-12 12:20:41 +02:00
Kconfig netfs: clean up after renaming FSCACHE_DEBUG config 2024-08-12 22:03:26 +02:00
locking.c netfs: Downgrade i_rwsem for a buffered write 2024-10-17 15:33:42 +02:00
main.c vfs-6.12.netfs 2024-09-16 12:13:31 +02:00
Makefile netfs: Speed up buffered reading 2024-09-12 12:20:41 +02:00
misc.c netfs: Fix a KMSAN uninit-value error in netfs_clear_buffer 2024-10-01 16:02:42 +02:00
objects.c netfs: Speed up buffered reading 2024-09-12 12:20:41 +02:00
read_collect.c netfs: In readahead, put the folio refs as soon extracted 2024-10-07 13:48:22 +02:00
read_pgpriv2.c cachefiles, netfs: Fix write to partial block at EOF 2024-09-12 12:20:41 +02:00
read_retry.c netfs: Speed up buffered reading 2024-09-12 12:20:41 +02:00
stats.c netfs: Speed up buffered reading 2024-09-12 12:20:41 +02:00
write_collect.c netfs: Speed up buffered reading 2024-09-12 12:20:41 +02:00
write_issue.c netfs: Fix missing wakeup after issuing writes 2024-10-02 16:56:15 +02:00