[RFC][PATH 0/4] Reduce excessive use of lock_rename() in overlayfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



lock_rename() is a very big hammer used before every call to vfs_rename(),
in order to avoid some horrible corner cases that are described in the
comment above vfs_rename().

lock_rename() taked a super block global mutex before every rename operation
that involved moving to a different parent and forces all such renames in
the file system to be serialized.

That cost may be acceptable to most workloads, because moving files/dirs
between directories are not as common as other file system operations.

Overlayfs uses vfs_rename() more that most file systems do, not only for
user requested renames, but also for every copy-up and every whiteout,
so vfs_rename() can be triggered from user operations open/create/delete,
that are much more common the renames.

It turns out, though, that all the horrible corner cases that require
the big lock_rename() hammer, can be eliminated when setting up the
overlay mount and then lock_rename() can be avoided in many use cases.

I do not have any performance results to show, which is really called
for in this sort of work. But it seems obvious that when running multiple
docker containers, file system operations should not be serialized among
all of them. So I am hoping that someone, with test machines stronger
than mine, can take this code to a test drive.

This code passed regression tests with unionmount-testsuite, pjdfstest
and xfstests -g quick.
It fails xfs tests generic/373 and generic/374 and for a good reason:
those tests try to mount 2 overlayfs mounts with the same upper/work dirs.
I will send patches to fix those 2 tests.

Amir Goldstein (4):
  vfs: reinterpret sillyrename flag as delete lock
  vfs: introduce delete trylock/unlock
  ovl: delete lock upper dir and work dir
  ovl: relax lock_rename when moving files between work and upper dir

 fs/afs/dir.c             |  6 ++---
 fs/btrfs/ioctl.c         |  5 ++--
 fs/namei.c               | 25 ++++++++++++++++---
 fs/overlayfs/copy_up.c   |  7 +++---
 fs/overlayfs/dir.c       | 25 +++++++++++++------
 fs/overlayfs/overlayfs.h |  2 ++
 fs/overlayfs/super.c     | 63 +++++++++++++++++++++++++++++++++++++++---------
 include/linux/dcache.h   | 35 +++++++++++++++++++++++++++
 include/linux/namei.h    |  2 ++
 9 files changed, 137 insertions(+), 33 deletions(-)

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux