linux_dsm_epyc7002/Documentation/filesystems
Eric Dumazet 8a81252b77 fs/file.c: don't acquire files->file_lock in fd_install()
Mateusz Guzik reported :

 Currently obtaining a new file descriptor results in locking fdtable
 twice - once in order to reserve a slot and second time to fill it.

Holding the spinlock in __fd_install() is needed in case a resize is
done, or to prevent a resize.

Mateusz provided an RFC patch and a micro benchmark :
  http://people.redhat.com/~mguzik/pipebench.c

A resize is an unlikely operation in a process lifetime,
as table size is at least doubled at every resize.

We can use RCU instead of the spinlock.

__fd_install() must wait if a resize is in progress.

The resize must block new __fd_install() callers from starting,
and wait that ongoing install are finished (synchronize_sched())

resize should be attempted by a single thread to not waste resources.

rcu_sched variant is used, as __fd_install() and expand_fdtable() run
from process context.

It gives us a ~30% speedup using pipebench on a dual Intel(R) Xeon(R)
CPU E5-2696 v2 @ 2.50GHz

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Mateusz Guzik <mguzik@redhat.com>
Acked-by: Mateusz Guzik <mguzik@redhat.com>
Tested-by: Mateusz Guzik <mguzik@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-07-01 02:30:09 -04:00
..
caching FS-Cache: Count the number of initialised operations 2015-04-02 14:28:53 +01:00
cifs update CIFS TODO list 2014-08-02 01:26:07 -05:00
configfs
nfs rdma: replace deprecated ifconfig in doc 2015-04-15 16:06:39 -04:00
pohmelfs
.gitignore Documentation: update .gitignore files 2014-09-26 11:02:59 +02:00
9p.txt 9p: update documentation 2014-01-24 10:55:21 -06:00
00-INDEX dax: replace XIP documentation with DAX documentation 2015-02-16 17:56:03 -08:00
adfs.txt
affs.txt affs: add mount option to avoid filename truncates 2014-04-07 16:36:08 -07:00
afs.txt
autofs4-mount-control.txt doc: fix double words 2014-03-21 13:16:58 +01:00
autofs4.txt autofs: the documentation I wanted to read 2014-10-14 02:18:17 +02:00
automount-support.txt Documentation: remove outdated information from automount-support.txt 2015-05-15 01:10:38 -04:00
befs.txt
bfs.txt
btrfs.txt btrfs: Add treelog mount option. 2014-01-28 13:20:20 -08:00
ceph.txt
coda.txt
cramfs.txt
dax.txt dax: does not work correctly with virtual aliasing caches 2015-02-16 17:56:04 -08:00
debugfs.txt debugfs: Have debugfs_print_regs32() return void 2014-11-05 14:13:38 -05:00
devpts.txt
directory-locking vfs: take i_mutex on renamed file 2013-11-09 00:16:40 -05:00
dlmfs.txt ocfs2: update web page + git tree in documentation 2015-02-28 09:57:50 -08:00
dnotify_test.c
dnotify.txt
ecryptfs.txt
efivarfs.txt efivarfs: Add documentation for the EFI variable filesystem 2012-10-30 10:39:18 +00:00
exofs.txt
ext2.txt ext2: get rid of most mentions of XIP in ext2 2015-02-16 17:56:04 -08:00
ext3.txt ext3: allow specifying external journal by pathname mount option 2013-07-31 22:11:15 +02:00
ext4.txt ext4: add DAX functionality 2015-02-16 17:56:04 -08:00
f2fs.txt f2fs: enable inline data by default 2015-04-10 15:08:52 -07:00
fiemap.txt fsioctl.c: make generic_block_fiemap() signal-tolerant 2015-02-10 14:30:30 -08:00
files.txt
fuse.txt
gfs2-glocks.txt
gfs2-uevents.txt
gfs2.txt
hfs.txt
hfsplus.txt Documentation: update URL to hfsplus Technote 1150 2014-02-20 14:48:51 +01:00
hpfs.txt
inotify.txt inotify: update documentation to reflect code changes 2015-02-10 14:30:28 -08:00
isofs.txt
jfs.txt doc: fix misspellings with 'codespell' tool 2013-05-28 12:02:12 +02:00
Locking switch ->put_link() from dentry to inode 2015-05-11 08:13:12 -04:00
locks.txt
logfs.txt
Makefile Documentation: add makefiles for more targets 2014-09-26 11:02:56 +02:00
mandatory-locking.txt
ncpfs.txt
nilfs2.txt nilfs2: update project's web site in nilfs2.txt 2014-04-03 16:21:26 -07:00
ntfs.txt NTFS: Remove changelog from Documentation/filesystems/ntfs.txt. 2014-10-16 12:43:57 +01:00
ocfs2.txt ocfs2: update web page + git tree in documentation 2015-02-28 09:57:50 -08:00
omfs.txt
overlayfs.txt ovl: document lower layer ordering 2015-01-08 15:09:15 +01:00
path-lookup.txt
porting fs/file.c: don't acquire files->file_lock in fd_install() 2015-07-01 02:30:09 -04:00
proc.txt The documentation tree update for 4.1. Numerous fixes, the overdue removal 2015-04-18 11:10:49 -04:00
qnx6.txt doc: filesystems : Fix typo in Documentations/filesystems 2013-08-20 13:45:56 +02:00
quota.txt
ramfs-rootfs-initramfs.txt initmpfs: use initramfs if rootfstype= or root= specified 2013-09-11 15:59:38 -07:00
relay.txt doc: Fix typo in doucmentations 2013-07-25 12:34:15 +02:00
romfs.txt
seq_file.txt Documentation: update seq_file 2014-12-29 15:40:18 -07:00
sharedsubtree.txt doc: spelling error changes 2014-05-05 15:32:05 +02:00
spufs.txt
squashfs.txt Squashfs: Add LZ4 compression configuration option 2014-11-27 18:48:44 +00:00
sysfs-pci.txt
sysfs-tagging.txt doc: Fix typo in doucmentations 2013-07-25 12:34:15 +02:00
sysfs.txt Documentation/filesystems/sysfs.txt: fix device_attribute declaration 2014-01-23 16:37:00 -08:00
sysv-fs.txt
tmpfs.txt
ubifs.txt
udf.txt
ufs.txt
vfat.txt fs/fat/: add support for DOS 1.x formatted volumes 2014-06-06 16:08:10 -07:00
vfs.txt update Documentation/filesystems/ regarding the follow_link/put_link changes 2015-05-15 01:10:36 -04:00
xfs-delayed-logging-design.txt
xfs-self-describing-metadata.txt xfs: add metadata CRC documentation 2013-04-27 13:27:43 -05:00
xfs.txt xfs: remove deprecated mount options 2015-02-24 10:17:04 +11:00