Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp255256pxb; Mon, 25 Apr 2022 09:24:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp00V7elndOKoot90BuyBuqXJVXvaME9nMZW189NRapajLid+7W3RP34PALmNkczdyagoF X-Received: by 2002:a63:f005:0:b0:3a3:ef7c:c8dd with SMTP id k5-20020a63f005000000b003a3ef7cc8ddmr15688681pgh.37.1650903878355; Mon, 25 Apr 2022 09:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650903878; cv=none; d=google.com; s=arc-20160816; b=c8+tz6qffwgf57VoOOdarmi7Owrfvt0g7YekZEfc9FuPjshD2Db1B2q+gANi6EN2xP TZAFhjZwaKgCZqz1VNv1h10EMp4iV4cvGJSL9ltuTnkgjALzT1I+iw0IGF8/ZGxC5hYT 970Bd+6f/w+D85ZrIHPCDx26KWG14kqzRJeXtRIIl3esztR1hsTwS9XAEFInGL79UF+w J4q1skabivbzx60QXr5uq7RFqVekPSxF7Zi9y0nvo6YklyYyUQLzKiMa9OVYjaSOHA24 z8FWfZpWyWFER828SImOnbNllXJxmfY1c3a/fR0a4yh88kKJ2AmfptsAS6dj82/lJHVo V74w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=ZW84Usvxn2hMTe46phsHlrx+EmFRCCuBMhEI5333hgg=; b=CrbNZepgiPtls8t1J6hp8noKlUL+zUonbIhnXdajogBkTnfvmMYXp7qSdNcRa6+O/I 1MacBWcwePl05ijwYG8E0XPyEut79AvaQrjbCr0Gb36Ji28qBx/tYzh0iAIcFUhXR1r9 UtzVryE6wxS43cll6MYYm42fXZqM2WxM6MiGYui4bliWk2hZhF0IAc9crALGf3ElNVuP 89CYKsowZfNbsfIi+lM4ur4ourek7HnsfzDXhGG4/IhHjOaQPhNs7whmIXgM+bOrBEDv VrgW22adkBRwHfPbcsI5p6cpPBLEORqtX7QmI7pTNL6InaxQS9TBGDqZNi/vcWsi6e5E hHAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=KGbPFhnc; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c21-20020a170902b69500b001571a069d8dsi15402045pls.432.2022.04.25.09.24.20; Mon, 25 Apr 2022 09:24:38 -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=@fieldses.org header.s=default header.b=KGbPFhnc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241335AbiDYQFm (ORCPT + 99 others); Mon, 25 Apr 2022 12:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238337AbiDYQFm (ORCPT ); Mon, 25 Apr 2022 12:05:42 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A611C1114E for ; Mon, 25 Apr 2022 09:02:37 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id AF7EC7114; Mon, 25 Apr 2022 12:02:36 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org AF7EC7114 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1650902556; bh=ZW84Usvxn2hMTe46phsHlrx+EmFRCCuBMhEI5333hgg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KGbPFhncQsJru7P+QRncvyk81zR3gaG62jijiye0TVRiSrDRAVQs7qPX5sIWjMq0p 1znqUR5mQ4eFeDb1bzQShWiI0KD++TsxD4ANCFKPr0Qr4gEBXL7cHi5X7At8GEHxP/ OHXd3gfJc5OUD68/Y5S7rCU1BQsyCo49MYZkgV68= Date: Mon, 25 Apr 2022 12:02:36 -0400 From: "J. Bruce Fields" To: Daire Byrne Cc: NeilBrown , Patrick Goetz , linux-nfs Subject: Re: parallel file create rates (+high latency) Message-ID: <20220425160236.GB24825@fieldses.org> References: <20220126025722.GD17638@fieldses.org> <20220211155949.GA4941@fieldses.org> <164517040900.10228.8956772146017892417@noble.neil.brown.name> <20220425132232.GA24825@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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 On Mon, Apr 25, 2022 at 04:24:50PM +0100, Daire Byrne wrote: > On Mon, 25 Apr 2022 at 14:22, J. Bruce Fields wrote: > > > > On Mon, Apr 25, 2022 at 02:00:32PM +0100, Daire Byrne wrote: > > > On Mon, 21 Feb 2022 at 13:59, Daire Byrne wrote: > > > > > > > > On Fri, 18 Feb 2022 at 07:46, NeilBrown wrote: > > > > > I've ported it to mainline without much trouble. I started some simple > > > > > testing (parallel create/delete of the same file) and hit a bug quite > > > > > easily. I fixed that (eventually) and then tried with more than 1 CPU, > > > > > and hit another bug. But then it was quitting time. If I can get rid > > > > > of all the easy to find bugs, I'll post it with a CC to you, and you can > > > > > find some more for me! > > > > > > > > That would be awesome! I have a real world production case for this > > > > and it's a pretty heavy workload. If that doesn't shake out any bugs, > > > > nothing will. > > > > > > > > The only caveat being that it will likely be restricted to NFSv3 > > > > testing due to the concurrency limitations with NFSv4.1+ (from the > > > > other thread). > > > > > > > > Daire > > > > > > Just to follow up on this again - I have been using Neil's patch for > > > parallel file creates (thanks!) but I'm a bit confused as to why it > > > doesn't seem to help in my NFS re-export case. > > > > > > With the patch, I can achieve much higher parallel (multi process) > > > creates directly on my re-export server to a high latency remote > > > server mount, but when I re-export that to multiple clients, the > > > aggregate create rate again degrades to that which we might expect > > > either without the patch or if there was only one process creating the > > > files in sequence. > > > > > > My assumption was that the nfsd threads of the re-export server would > > > act as multiple independent processes and it's clients would be spread > > > across them such that they would also benefit from the parallel > > > creates patch on the re-export server. So I expected many clients > > > creating files in the same directory would achieve much higher > > > aggregate performance. > > > > That's the idea. > > > > I've lost track, where's the latest version of Neil's patch? > > > > --b. > > The latest is still the one from this thread (with a minor update to > apply it to v5.18-rc): > > https://lore.kernel.org/lkml/893053D7-E5DD-43DB-941A-05C10FF5F396@dilger.ca/T/#m922999bf830cacb745f32cc464caf72d5ffa7c2c Thanks! I haven't really tried to understand that patch--but just looking at the diffstat, it doesn't touch fs/nfsd/. And nfsd calls into the vfs only after it locks the parent. So nfsd is probably still using the old behavior, where local callers are using the new (parallel) behavior. So I bet what you're seeing is expected, and all that's needed is some updates to fs/nfsd/vfs.c to reflect whatever Neil did in fs/namei.c. --b. > My test is something like this: > > reexport1 # for x in {1..5000}; do > echo /srv/server1/touch.$HOSTNAME.$x > done | xargs -n1 -P 200 -iX -t touch X 2>&1 | pv -l -a >|/dev/null > > Without the patch this results in 3 creates/s and with the patch it's > ~250 creates/s with 200 threads/processes (200ms latency) when run > directly against a remote RHEL8 server (server1). > > Then I run something similar to this but simultaneously across 200 > clients of the "reexport1" server's re-export of the originating > "server1". I get an aggregate of around 3 creates/s even with the > patch applied to reexport1 (v5.18-rc2) which is suspiciously similar > to the performance without the parallel vfs create patch. > > The clients don't run any special kernels or configurations. I have > only tested NFSv3 so far. > > Daire