Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1181463iob; Wed, 4 May 2022 16:47:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZREr1+MAkAjuhlMLVIgKxMNp+/3MDYgvTcQvTYY720rd74yg7n0nFqRFy2A778GLbxWbT X-Received: by 2002:a17:907:62a9:b0:6da:7953:4df0 with SMTP id nd41-20020a17090762a900b006da79534df0mr22524522ejc.316.1651708074500; Wed, 04 May 2022 16:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651708074; cv=none; d=google.com; s=arc-20160816; b=RwnUdL9EXs7LeRYbaFcpYkHYGIUhAfDVK5oqKSuHdaY42equUZzwfVmchntcREbZHl MeFrDXhutkfW199tsJOc3wm8i9pIGqnX1++EnHf8BlCj+Zq1EV/Iv/7hTr1ULAN563+9 YcVhXlAK9xjq9JNITw9frGvlnyhs0iNS+GhBKONqzJwcfqNR17lYiLH2QzU27Q/K/+V/ kI4lUMcxIEA6OLcGdJSEXcdZNEUqMyRpXLhK0LVO7YlPAvab30GkLHm9i/lRsEpGFhBo 6tDqcEmDY/hUuc9uIjXXEb/kzsWOsVJVz4CxUfu26fAScoi6fdPnhOXIzgRWe5sS2IsN v7YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZwSljj3c5T6Utkzz17OaX0BViEESRn+BH5N5ceRLoVg=; b=fkRaGKBq8XLRLsmeGZrlg1QFq6bfP3HTMo558OVzIZs9a1Jzgbly863pug6axYSuvB UV+3I/gXH2sarYOTpEpBPwVQVkXpZcWszyqxQ27TsO5GpQnnbdrYYAMMGBH4hA7ktQqA 5XoVE6ITe9vgM7VbKSnZ/vbpgXpTyqjdLZFPx0qbEUfn/le7HybDn/y3/hFXsL/UcOsV RG/y2/JZ6rPd86wqFugXo6PYu232bGBFVPC7hsOaz+dW3vYEoKBvyk5v7DHTHB954YTH 4rAVy5gUlE6GDpIxA9FDomdoFCAkfyKul1MnG9U7vUpD71ehTaVhkQ2xKUmse4dLpzRQ EHvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FexlnEss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s28-20020a05640217dc00b00427c2e8450asi36655edy.526.2022.05.04.16.47.27; Wed, 04 May 2022 16:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@redhat.com header.s=mimecast20190719 header.b=FexlnEss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356002AbiEDTWg (ORCPT + 99 others); Wed, 4 May 2022 15:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355757AbiEDTWe (ORCPT ); Wed, 4 May 2022 15:22:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A86382558F for ; Wed, 4 May 2022 12:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651691936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZwSljj3c5T6Utkzz17OaX0BViEESRn+BH5N5ceRLoVg=; b=FexlnEssIAWDbxMIb8t3GSbRA7HoAucWtBzf8Rl6TRIFgW3tKVeon1kWYu3ZgoFPRl4hgI ECznpE9OtJpH/PuyLlg29f0nWiRWqgkh73I3V+ViDXeU4AaSPv6yq/0UtrBWj16KwWq8r9 w3ItsPNBXesKpQ/MEZzzxboZuDKz2Mc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-bsMMlQ16PiqoSZ-tI920Ng-1; Wed, 04 May 2022 15:18:53 -0400 X-MC-Unique: bsMMlQ16PiqoSZ-tI920Ng-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 72B83101AA47; Wed, 4 May 2022 19:18:53 +0000 (UTC) Received: from horse.redhat.com (unknown [10.22.16.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63326400E896; Wed, 4 May 2022 19:18:53 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 21F9D220463; Wed, 4 May 2022 15:18:53 -0400 (EDT) Date: Wed, 4 May 2022 15:18:53 -0400 From: Vivek Goyal To: Dharmendra Singh Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, bschubert@ddn.com Subject: Re: [PATCH v4 0/3] FUSE: Implement atomic lookup + open/create Message-ID: References: <20220502102521.22875-1-dharamhans87@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220502102521.22875-1-dharamhans87@gmail.com> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,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-kernel@vger.kernel.org On Mon, May 02, 2022 at 03:55:18PM +0530, Dharmendra Singh wrote: > In FUSE, as of now, uncached lookups are expensive over the wire. > E.g additional latencies and stressing (meta data) servers from > thousands of clients. These lookup calls possibly can be avoided > in some cases. Incoming three patches address this issue. BTW, these patches are designed to improve performance by cutting down on number of fuse commands sent. Are there any performance numbers which demonstrate what kind of improvement you are seeing. Say, If I do kernel build, is the performance improvement observable? Thanks Vivek > > > Fist patch handles the case where we are creating a file with O_CREAT. > Before we go for file creation, we do a lookup on the file which is most > likely non-existent. After this lookup is done, we again go into libfuse > to create file. Such lookups where file is most likely non-existent, can > be avoided. > > Second patch handles the case where we open first time a file/dir > but do a lookup first on it. After lookup is performed we make another > call into libfuse to open the file. Now these two separate calls into > libfuse can be combined and performed as a single call into libfuse. > > Third patch handles the case when we are opening an already existing file > (positive dentry). Before this open call, we re-validate the inode and > this re-validation does a lookup on the file and verify the inode. > This separate lookup also can be avoided (for non-dir) and combined > with open call into libfuse. After open returns we can revalidate the inode. > This optimisation is performed only when we do not have default permissions > enabled. > > Here is the link to performance numbers > https://lore.kernel.org/linux-fsdevel/20220322121212.5087-1-dharamhans87@gmail.com/ > > > Dharmendra Singh (3): > FUSE: Implement atomic lookup + create > Implement atomic lookup + open > Avoid lookup in d_revalidate() > > fs/fuse/dir.c | 211 +++++++++++++++++++++++++++++++++++--- > fs/fuse/file.c | 30 +++++- > fs/fuse/fuse_i.h | 16 ++- > fs/fuse/inode.c | 4 +- > fs/fuse/ioctl.c | 2 +- > include/uapi/linux/fuse.h | 5 + > 6 files changed, 246 insertions(+), 22 deletions(-) > > --- > v4: Addressed all comments and refactored the code into 3 separate patches > respectively for Atomic create, Atomic open, optimizing lookup in > d_revalidate(). > --- >