From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH 0/6] ovl: concurrent copy up
Date: Sun, 15 Jan 2017 15:57:26 +0200 [thread overview]
Message-ID: <1484488652-611-1-git-send-email-amir73il@gmail.com> (raw)
Miklos,
This is my 2nd attempt to implement concurrent copy up
in overlayfs (3rd if you count the DCACHE_DELETE_LOCK flop).
It's not tagged as V2, because there is nothing in common
between the previous attempt and this one.
This work is based on Al's suggestion to use O_TMPFILE
for regular files and your very helpful waitqueue patch.
Patches 1-4 implement copy up of regular file using O_TMPFILE.
Since there is more common then different code wrt O_TMPFILE
vs. workdir+rename, I opted to keep ovl_copy_up_one() and
copy_up_one_locked() functions with a few 'if (tmpfile) else'
sprinkled around. It may be better to clone copy_up_one_locked()?
Patch 5 is the waitqueue patch you sent me. My only additions are
init_waitqueue_head() and wake_up_lock(), so I kept you as author.
Patch 6 puts it all together. Once again, in an attempt to keep
more common code, I added a few 'if (tmpfile)' and kept the locking
code generic, by assigning workdir = upperdir. I thought you may not
approve with this trick, but couldn't resist trying.
Beyond this simple test:
$ touch /lower/{empty,4g}
$ truncate -s 4g /lower/4g
$ touch /mnt/4g & # takes a while
$ touch /mnt/empty # exits immediately
$ touch /mnt/4g # blocks until %1 completes and can be interrupted
I also wrote xfstest overlay/021 which exercises concurrent copy up
using 8 processes on 4 directories and 4K files.
Amir.
Amir Goldstein (5):
vfs: create vfs helper vfs_tmpfile()
ovl: check if upperdir fs supports O_TMPFILE
ovl: rearrange code in ovl_copy_up_locked()
ovl: copy up regular file using O_TMPFILE
ovl: concurrent copy up of regular files
Miklos Szeredi (1):
ovl: introduce copy up waitqueue
fs/namei.c | 26 +++++++++-------
fs/overlayfs/copy_up.c | 78 +++++++++++++++++++++++++++++++++++-------------
fs/overlayfs/overlayfs.h | 13 ++++++++
fs/overlayfs/ovl_entry.h | 3 ++
fs/overlayfs/super.c | 11 +++++++
fs/overlayfs/util.c | 68 +++++++++++++++++++++++++++++++++++++++++
include/linux/fs.h | 1 +
7 files changed, 170 insertions(+), 30 deletions(-)
--
2.7.4
next reply other threads:[~2017-01-15 13:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-15 13:57 Amir Goldstein [this message]
2017-01-15 13:57 ` [PATCH 1/6] vfs: create vfs helper vfs_tmpfile() Amir Goldstein
2017-01-16 11:00 ` Miklos Szeredi
2017-01-16 11:19 ` Amir Goldstein
2017-01-16 13:22 ` Miklos Szeredi
2017-01-16 14:04 ` Amir Goldstein
2017-01-16 14:15 ` Miklos Szeredi
2017-01-15 13:57 ` [PATCH 2/6] ovl: check if upperdir fs supports O_TMPFILE Amir Goldstein
2017-01-16 14:02 ` Miklos Szeredi
2017-01-16 14:16 ` Amir Goldstein
2017-01-16 14:29 ` Miklos Szeredi
2017-01-15 13:57 ` [PATCH 3/6] ovl: rearrange code in ovl_copy_up_locked() Amir Goldstein
2017-01-15 13:57 ` [PATCH 4/6] ovl: copy up regular file using O_TMPFILE Amir Goldstein
2017-01-15 13:57 ` [PATCH 5/6] ovl: introduce copy up waitqueue Amir Goldstein
2017-01-15 13:57 ` [PATCH 6/6] ovl: concurrent copy up of regular files Amir Goldstein
2017-01-16 11:05 ` Miklos Szeredi
2017-01-16 11:31 ` Amir Goldstein
2017-01-16 11:58 ` [PATCH v2 " Amir Goldstein
2017-01-16 13:29 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1484488652-611-1-git-send-email-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).