Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8900167ybl; Fri, 17 Jan 2020 03:06:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwOJUGlfAsRrqaEuq1PlWgQnOOSqds9ALsUUq2cBbHGmfOQl8KrzEWvoJYjzBQGchFe1yPH X-Received: by 2002:a05:6830:20d3:: with SMTP id z19mr5358586otq.330.1579259206523; Fri, 17 Jan 2020 03:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579259206; cv=none; d=google.com; s=arc-20160816; b=l1n+NoolETtMs/4Af906XToBZ5TGJNpzlyldPbw51+rSULoz3FRJKMTSXbCc8n9yAf Q1cMxnEiaayqPIustVrFhnYrAb/+5FqPF7B70OBBu697rnKncuHXRVHnS7TNJDv6E30N +4DV2VurxFLwtuZjaC6EFHH+thUGkVZFJg7HL5hnwq73X1qQHywVd1F9NL3gw9zCp9Bp bY3tYGMNiF3ddJPR8+A4dzsdb/uJqwdpMcbvZdaj39/ctkVBPWkfctQ2uZmx2GHOrotZ OjZX7ekiHi6vPWxK5Xyhhjx+SCZ7B0ySMMXrPhMybpTj2D9SRALrb7DP0El4ENfdYyFh 7/OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=dlSUH7QXAYDEr1nQK9fztVji2WHR4L7xXFCLX8MrEPk=; b=WnYbTMUdv+0/BCwnrXN2EgQ6x5updp1SMVW7mLupn7WWXvV4ILCYpeXRMb5ubyWKaD /saFqkHokpfMPIbgmcDVqm8F1j4bD1HaTTw4XRH/F1+ZWtcU6nftamLnZnuNp5t+jAxd ZLLFvmqVnqft0kkb+ZDFe43FPkWie2UCCGS4Ary6MneO7pOjtZIYMkE+JwMWUWXYrBe8 uQ1POb4CkVLrlUHYLl3wHm3CHeKfyInhwdajX9Xbz0DveQpwgLH12Vw8bwjlJnxhSmvO Gm7tiqHEtNGX/J2NPaRyvVCv8QQlpmQcsSip+WX6ZtViPVxwoTu4CE8X4vIFWO1/3bB/ XP2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f204si11561765oia.43.2020.01.17.03.06.32; Fri, 17 Jan 2020 03:06:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726861AbgAQLFi (ORCPT + 99 others); Fri, 17 Jan 2020 06:05:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:36412 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726343AbgAQLFh (ORCPT ); Fri, 17 Jan 2020 06:05:37 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7FF90ADE7; Fri, 17 Jan 2020 11:05:36 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 0C1241E0D53; Fri, 17 Jan 2020 12:05:36 +0100 (CET) Date: Fri, 17 Jan 2020 12:05:36 +0100 From: Jan Kara To: "yukuai (C)" Cc: Jan Kara , hch@infradead.org, darrick.wong@oracle.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, houtao1@huawei.com, zhengbin13@huawei.com, yi.zhang@huawei.com Subject: Re: [RFC] iomap: fix race between readahead and direct write Message-ID: <20200117110536.GE17141@quack2.suse.cz> References: <20200116063601.39201-1-yukuai3@huawei.com> <20200116153206.GF8446@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 17-01-20 17:39:03, yukuai (C) wrote: > On 2020/1/16 23:32, Jan Kara wrote: > > Thanks for the report and the patch. But the data integrity when mixing > > buffered and direct IO like this is best effort only. We definitely do not > > want to sacrifice performance of common cases or code complexity to make > > cases like this work reliably. > > In the patch, the only thing that is diffrent is that iomap_begin() will > be called for each page. However, it seems the performance in sequential > read didn't get worse. Is there a specific case that the performance > will get worse? Well, one of the big points of iomap infrastructure is that you call filesystem once to give you large extent instead of calling it to provide allocation for each page separately. The additional CPU overhead will be visible if you push the machine hard enough. So IMHO the overhead just is not worth it for a corner-case like you presented. But that's just my opinion, Darrick and Christoph are definitive arbiters here... Honza -- Jan Kara SUSE Labs, CR