]> git.ipfire.org Git - people/ms/linux.git/commit - fs/namespace.c
ovl: make private mounts longterm
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 4 Jun 2020 08:48:19 +0000 (10:48 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 4 Jun 2020 08:48:19 +0000 (10:48 +0200)
commitdf820f8de4e481222b17f9bcee7b909ae8167529
tree8410725a7cd85f540f59120710b8617c18348670
parentb8e42a651bdee06202ebdd96cff64fdeabd5b1d6
ovl: make private mounts longterm

Overlayfs is using clone_private_mount() to create internal mounts for
underlying layers.  These are used for operations requiring a path, such as
dentry_open().

Since these private mounts are not in any namespace they are treated as
short term, "detached" mounts and mntput() involves taking the global
mount_lock, which can result in serious cacheline pingpong.

Make these private mounts longterm instead, which trade the penalty on
mntput() for a slightly longer shutdown time due to an added RCU grace
period when putting these mounts.

Introduce a new helper kern_unmount_many() that can take care of multiple
longterm mounts with a single RCU grace period.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Documentation/filesystems/porting.rst
fs/namespace.c
fs/overlayfs/super.c
include/linux/mount.h