Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933060AbcKGRlL (ORCPT ); Mon, 7 Nov 2016 12:41:11 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35609 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932380AbcKGRlE (ORCPT ); Mon, 7 Nov 2016 12:41:04 -0500 MIME-Version: 1.0 In-Reply-To: References: <1477380887-21333-1-git-send-email-mszeredi@redhat.com> <1477380887-21333-4-git-send-email-mszeredi@redhat.com> <20161025115748.ydhkkp5cfcdnjzwn@home.ouaza.com> From: Amir Goldstein Date: Mon, 7 Nov 2016 15:38:19 +0200 Message-ID: Subject: Re: [PATCH 3/3] ovl: redirect on rename-dir To: Konstantin Khlebnikov Cc: Miklos Szeredi , Raphael Hertzog , Miklos Szeredi , "linux-unionfs@vger.kernel.org" , Guillem Jover , linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1426 Lines: 31 On Mon, Nov 7, 2016 at 12:08 PM, Konstantin Khlebnikov wrote: > On Mon, Nov 7, 2016 at 1:04 PM, Miklos Szeredi wrote: >> On Mon, Nov 7, 2016 at 10:58 AM, Konstantin Khlebnikov wrote: >> >>> I've stumbled on somehow related problem - concurrent copy-ups are >>> strictly serialized by rename locks. >>> Obviously, file copying could be done in parallel: locks are required >>> only for final rename. >>> Because of that overlay slower that aufs for some workloads. >> >> Easy to fix: for each copy up create a separate subdir of "work". >> Then the contention is only for the time of creating the subdir, which >> is very short. > > Yeah, but lock_rename() also takes per-sb s_vfs_rename_mutex (kludge by Al Viro) > I think proper synchronization for concurrent copy-up (for example > round flag on ovl_entry) and locking rename only for rename could be > better. Removing s_vfs_rename_mutex from copy-up path is something I have been pondering about. Assuming that I understand Al's comment above vfs_rename() correctly, the sole purpose of per-sb serialization is to prevent loop creations. However, how can one create a loop by moving a non-directory? So it looks like at least for the non-dir copy up case, a much finer grained lock is in order. Anyway, it's on my todo list, as concurrent operation performance on overlayfs is important to out use case. Amir.