Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp922971iog; Mon, 13 Jun 2022 16:21:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLjnxkkD9ZZKIrMVz/WulTOWCDPdqw8Osml3FxYH0Ia4g+cEv9vJ9dkwH9y44OaNFmN5Ow X-Received: by 2002:a17:906:f293:b0:718:82e3:226b with SMTP id gu19-20020a170906f29300b0071882e3226bmr1789484ejb.676.1655162502060; Mon, 13 Jun 2022 16:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655162502; cv=none; d=google.com; s=arc-20160816; b=QEhPxj2nt8Huo3o1ihEa/pGb2ERQpse3qcyypBAfyhDjYEP3iugvUsuB6AmpNZKSRr oJgbLRVmFaQb5dlGgfuqEtMTAFwpHaXY0c8ZL1tBWAUdo1e4+bhKKYVyYo+3taBn0Yjl uIyc/Y204vDTzervRLPg8kyZNjb0LYwB5MEumB49QHmZpr5PkKrwBLb2EvhBtii82G8P Ra910zAfZKU3BJQ7qQaAyO/WwPoDt/BAieKA5Axn8s26edU14nceh8UfvnH6i7IOTFU3 mIbtrcfF/eW8IC0zt148gu8zY2j5wajQaU2SR/Z5m01tWYPdNaPDC1QoWmClN6x8sAMn Zlqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature :dkim-signature; bh=IkkdWLZCbKTXcy+wyaIkRfefAaKEDvHsBtJt3VONYgA=; b=LfC5TcLsiJ//CHzOAL5Bh65hz091F1dO7F6rQ6vvVj15rEqOP4046MpdMlPnCXLftd 8AZxw9nxfUAz3aFg3f25oFScKMma6z5D8PNph7SVZZh5IAhjd1i7/aYXB+zNXKcY+lj8 nESIfw7xC7e1mcGY5cpGBa25D+qLIH6BEzaXlAjCA7UjrYSoojL5L71nFW5eUXezOIp8 po4P9a4DURLj0ucPddbBKIF3BKiPi/PY+te1gSw726mws9UCH9U02i1WGgzVTNoeDi7i Pm0HM39ljGEizSm+GcO8+wPugy+H+ZDwIYAK2WFLBcdYIU4DMGQH+NnKOWHmXGqyn+Ny qvQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=DwoBafhY; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=rTVSAXoR; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne9-20020a1709077b8900b006f4cbc841d7si11121488ejc.1005.2022.06.13.16.21.02; Mon, 13 Jun 2022 16:21:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=DwoBafhY; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=rTVSAXoR; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230388AbiFMXT6 (ORCPT + 99 others); Mon, 13 Jun 2022 19:19:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiFMXT6 (ORCPT ); Mon, 13 Jun 2022 19:19:58 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12AD860EC; Mon, 13 Jun 2022 16:19:57 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3A7A421A94; Mon, 13 Jun 2022 23:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655162395; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IkkdWLZCbKTXcy+wyaIkRfefAaKEDvHsBtJt3VONYgA=; b=DwoBafhYE+kEHIlypI4/grEhAWzHf/UF0VyDCgMKrgDJIGweAh+P0DadbfI9RAZBJNPQa+ b4/IGqGuitKJ+50MHrB/4WdGI38yXlh2GAMi0YPwrODaoyDlNw0fAAcpnFtVN3IlE7JsG/ xSyF9acA9PeEVuQqiHrU7/0jevn20F0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655162395; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IkkdWLZCbKTXcy+wyaIkRfefAaKEDvHsBtJt3VONYgA=; b=rTVSAXoRTxOBYxsL5LWjJ+V89M/2QCl+IeuxWV/KKnz855LQKX2t8MUT5Qa9Iw3n0NTlzr yQtVtGj9veHk/NAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F1619134CF; Mon, 13 Jun 2022 23:19:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id M9J8KhjGp2KXbwAAMHmgww (envelope-from ); Mon, 13 Jun 2022 23:19:52 +0000 Subject: [PATCH RFC 00/12] Allow concurrent directory updates. From: NeilBrown To: Al Viro , Daire Byrne , Trond Myklebust , Chuck Lever Cc: Linux NFS Mailing List , linux-fsdevel@vger.kernel.org, LKML Date: Tue, 14 Jun 2022 09:18:21 +1000 Message-ID: <165516173293.21248.14587048046993234326.stgit@noble.brown> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org VFS currently holds an exclusive lock on a directory during create, unlink, rename. This imposes serialisation on all filesystems though some may not benefit from it, and some may be able to provide finer grained locking internally, thus reducing contention. This series allows the filesystem to request that the inode lock be shared rather than exclusive. In that case an exclusive lock will be held on the dentry instead, much as is done for parallel lookup. The NFS filesystem can easily support concurrent updates (server does any needed serialiation) so it is converted. This series also converts nfsd to use the new interfaces so concurrent incoming NFS requests in the one directory can be handled concurrently. As a net result, if an NFS mounted filesystem is reexported over NFS, then multiple clients can create files in a single directory and all synchronisation will be handled on the final server. This helps hid latency on link from client to server. I include a few nfsd patches that aren't strictly needed for this work, but seem to be a logical consequence of the changes that I did have to make. I have only tested this lightly. In particular the rename support is quite new and I haven't tried to break it yet. I post this for general review, and hopefully extra testing... Daire Byrne has expressed interest in the NFS re-export parallelism. NeilBrown --- NeilBrown (12): VFS: support parallel updates in the one directory. VFS: move EEXIST and ENOENT tests into lookup_hash_update() VFS: move want_write checks into lookup_hash_update() VFS: move dput() and mnt_drop_write() into done_path_update() VFS: export done_path_update() VFS: support concurrent renames. NFS: support parallel updates in the one directory. nfsd: allow parallel creates from nfsd nfsd: support concurrent renames. nfsd: reduce locking in nfsd_lookup() nfsd: use (un)lock_inode instead of fh_(un)lock nfsd: discard fh_locked flag and fh_lock/fh_unlock fs/dcache.c | 59 ++++- fs/namei.c | 578 ++++++++++++++++++++++++++++++++--------- fs/nfs/dir.c | 29 ++- fs/nfs/inode.c | 2 + fs/nfs/unlink.c | 5 +- fs/nfsd/nfs2acl.c | 6 +- fs/nfsd/nfs3acl.c | 4 +- fs/nfsd/nfs3proc.c | 37 +-- fs/nfsd/nfs4acl.c | 7 +- fs/nfsd/nfs4proc.c | 61 ++--- fs/nfsd/nfs4state.c | 8 +- fs/nfsd/nfsfh.c | 10 +- fs/nfsd/nfsfh.h | 58 +---- fs/nfsd/nfsproc.c | 31 +-- fs/nfsd/vfs.c | 243 ++++++++--------- fs/nfsd/vfs.h | 8 +- include/linux/dcache.h | 27 ++ include/linux/fs.h | 1 + include/linux/namei.h | 30 ++- 19 files changed, 791 insertions(+), 413 deletions(-) -- Signature