From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8BB1C7EE2C for ; Thu, 24 Aug 2023 04:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236657AbjHXEc0 (ORCPT ); Thu, 24 Aug 2023 00:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239097AbjHXEcU (ORCPT ); Thu, 24 Aug 2023 00:32:20 -0400 Received: from out-28.mta0.migadu.com (out-28.mta0.migadu.com [91.218.175.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAA75E68 for ; Wed, 23 Aug 2023 21:32:17 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1692851536; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ppgphILGWctxKMPfp+OEMQ0YhWTuBxKxE8/aT7easbE=; b=Tghl+n7Kb0zW+vfX1rhekKc59qBms4Lj2F+tQHJBWIys6gjzrUNZauIxqOUONNNmMaQ/Sq f/K5Zx5JJwvlfvCh+kwZ1Oh7A/5kN58SHq1+DNk6U5Dr9kTmn/cUdF7Zz28D46/hOB908o jTlV3NxwLbhZPMV5F21ZLBPTDBzt1A0= Date: Thu, 24 Aug 2023 12:32:08 +0800 MIME-Version: 1.0 Subject: Re: [fuse-devel] [PATCH 1/2] [RFC for fuse-next ] fuse: DIO writes always use the same code path Content-Language: en-US To: Miklos Szeredi , Bernd Schubert Cc: fuse-devel@lists.sourceforge.net, bernd.schubert@fastmail.fm, Christoph Hellwig , Hao Xu , Dharmendra Singh , linux-fsdevel@vger.kernel.org References: <20230821174753.2736850-1-bschubert@ddn.com> <20230821174753.2736850-2-bschubert@ddn.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Hao Xu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 8/22/23 17:53, Miklos Szeredi via fuse-devel wrote: > On Mon, 21 Aug 2023 at 19:48, Bernd Schubert wrote: >> There were two code paths direct-io writes could >> take. When daemon/server side did not set FOPEN_DIRECT_IO >> fuse_cache_write_iter -> direct_write_fallback >> and with FOPEN_DIRECT_IO being set >> fuse_direct_write_iter >> >> Advantage of fuse_direct_write_iter is that it has optimizations >> for parallel DIO writes - it might only take a shared inode lock, >> instead of the exclusive lock. >> >> With commits b5a2a3a0b776/80e4f25262f9 the fuse_direct_write_iter >> path also handles concurrent page IO (dirty flush and page release), >> just the condition on fc->direct_io_relax had to be removed. >> >> Performance wise this basically gives the same improvements as >> commit 153524053bbb, just O_DIRECT is sufficient, without the need >> that server side sets FOPEN_DIRECT_IO >> (it has to set FOPEN_PARALLEL_DIRECT_WRITES), though. > Consolidating the various direct IO paths would be really nice. > > Problem is that fuse_direct_write_iter() lacks some code from > generic_file_direct_write() and also completely lacks I see, seems the page invalidation post direct write is needed as well. > direct_write_fallback(). So more thought needs to go into this. > > Thanks, > Miklos > >