Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3306145pxb; Tue, 19 Jan 2021 20:53:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLgHkKnu+oKZ8AX1rwA9WjWBaiOCXBG0aEA7nJn9O+5MpBPE1aOyyR9M/ESogP/3ku/Ei5 X-Received: by 2002:a50:fb97:: with SMTP id e23mr6114552edq.208.1611118398573; Tue, 19 Jan 2021 20:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611118398; cv=none; d=google.com; s=arc-20160816; b=Yy1jrZBye2dP+OzPcQeysQ1cmB/fDEpQGrzcH78eJ4L2GJvSL+3m94Ka/U7nVZhDj1 NSpPotbrMGy/U9HPs9o6Ti55wJQcTHnvCn8N1y1YUYn37cmxndLh16M4TLjP3eZMH36r 3oInbMcfdDVDRzMcLX7ENA8QFO2BW5PYC5uR6VRZMOMX2QAYALg0HRlyA/FSsWRu0lb5 r8bD/bG3zkK9LD7DGH9maajV6IUahEX5yMWN0v7jNz/gkBaoxDYJXOihBlP7T1WvNHLO kN1RVfrJgLMJ2tCE1+vcoyTUwRcpkSoMFNTRWiTu+9kNpbuS76W9/vy90+x6MXM1pFMx eSIw== 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; bh=1vhL8RIpnkT6GQTm3LFfgtlRlohuvkGxUiA5z/5rN8w=; b=Z+COeO1HcvoAHgudYZQs7F+n9GLZHJ8kA2IKzqnc5M9eFbjRahRskAxEmrmmwtWvOl IQJYz4CyNfrM9qTFJY4yfnTXXZI1BkMConF6J3qwmCkbC0AvCs0EIjrtTmlqns/PyNfb TdJi62UxDYIqY6q0mPbG0abVfLI+GrTcAKffFXYuACI8/9n0O0ovyIDypI0o3eJ1520M rr3fKNm1IzfjzKjoEUbSuIXjj0EfA8GmLW0lbTNHbSveeOZ1h0Kxb49M45w/Fo+EVvDN 6puMEjvR8a9Ez5XLXvidk072V9sb+j4gPpftzitwISO+SnrbNszmrcxtbgplQgf1DvDd sFEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lh11si315167ejb.543.2021.01.19.20.52.54; Tue, 19 Jan 2021 20:53:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbhATEuj (ORCPT + 99 others); Tue, 19 Jan 2021 23:50:39 -0500 Received: from mail109.syd.optusnet.com.au ([211.29.132.80]:52082 "EHLO mail109.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727683AbhATErs (ORCPT ); Tue, 19 Jan 2021 23:47:48 -0500 Received: from dread.disaster.area (pa49-180-243-77.pa.nsw.optusnet.com.au [49.180.243.77]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id C28BD114056B; Wed, 20 Jan 2021 15:47:01 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1l25OW-000Pbc-9B; Wed, 20 Jan 2021 15:47:00 +1100 Date: Wed, 20 Jan 2021 15:47:00 +1100 From: Dave Chinner To: Zhongwei Cai Cc: Mikulas Patocka , Theodore Ts'o , Matthew Wilcox , David Laight , Mingkai Dong , Andrew Morton , Jan Kara , Steven Whitehouse , Eric Sandeen , Dave Chinner , Wang Jianchao , Rajesh Tadakamadla , linux-kernel , linux-fsdevel , linux-nvdimm Subject: Re: Expense of read_iter Message-ID: <20210120044700.GA4626@dread.disaster.area> References: <20210107151125.GB5270@casper.infradead.org> <17045315-CC1F-4165-B8E3-BA55DD16D46B@gmail.com> <2041983017.5681521.1610459100858.JavaMail.zimbra@sjtu.edu.cn> <1224425872.715547.1610703643424.JavaMail.zimbra@sjtu.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1224425872.715547.1610703643424.JavaMail.zimbra@sjtu.edu.cn> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=F8MpiZpN c=1 sm=1 tr=0 cx=a_idp_d a=juxvdbeFDU67v5YkIhU0sw==:117 a=juxvdbeFDU67v5YkIhU0sw==:17 a=kj9zAlcOel0A:10 a=EmqxpYm9HcoA:10 a=7-415B0cAAAA:8 a=9YBCWnU3LXitusiQSpoA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 05:40:43PM +0800, Zhongwei Cai wrote: > On Thu, 14 Jan 2021, Mikulas wrote: > For Ext4-dax, the overhead of dax_iomap_rw is significant > compared to the overhead of struct iov_iter. Although methods > proposed by Mikulas can eliminate the overhead of iov_iter > well, they can not be applied in Ext4-dax unless we implement an > internal "read" method in Ext4-dax. > > For Ext4-dax, there could be two approaches to optimizing: > 1) implementing the internal "read" method without the complexity > of iterators and dax_iomap_rw; Please do not go an re-invent the wheel just for ext4. If there's a problem in a shared path - ext2, FUSE and XFS all use dax_iomap_rw() as well, so any improvements to that path benefit all DAX users, not just ext4. > 2) optimizing how dax_iomap_rw works. > Since dax_iomap_rw requires ext4_iomap_begin, which further involves > the iomap structure and others (e.g., journaling status locks in Ext4), > we think implementing the internal "read" method would be easier. Maybe it is, but it's also very selfish. The DAX iomap path was written to be correct for all users, not inecessarily provide optimal performance. There will be lots of things that could be done to optimise it, so rather than creating a special snowflake in ext4 that makes DAX in ext4 much harder to maintain for non-ext4 DAX developers, please work to improve the common DAX IO path and so provide the same benefit to all the filesystems that use it. Cheers, Dave. -- Dave Chinner david@fromorbit.com