Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp334426img; Tue, 26 Feb 2019 00:32:06 -0800 (PST) X-Google-Smtp-Source: AHgI3IbBd3eUr5Ro3/7LOKU0HPWF7t0n3dM+J2hTLkUB9t+N/k6p1fQQhmVOLPOA1Gr/WF6HTsle X-Received: by 2002:a17:902:b609:: with SMTP id b9mr25139696pls.134.1551169926405; Tue, 26 Feb 2019 00:32:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551169926; cv=none; d=google.com; s=arc-20160816; b=FjqQ2+csJgtD1NRKpnYVHhwQFx9B3v234cJknfJ4oj376dD3CH5Sb5JT4B2p7NIktY CZeRogPC7bn6KeEDg6F2L4T1TKoazTx3EonAf3S6E+t9jw00w4ltlPXVlmcPCOtxD/vi rhcaw9aj52bx3FSKkb952sn3eq3zPni16dHAdWG4icSHvR+54pisXnE16JwjC6QTZHqw rn9P99UiQl16HBo/mknLOkKaugtyGEo7XCsiGECakskJ9HIzQEyp12bOe++30UQZ+KYB oyWdY8L/G7cCZJr/u8U1JnfxhXcvs534UlWg74TZ9A6eW478t1pzIeMil7pFz71JzuUf rZWQ== 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=K0xEnf17LQRqTu1V+m2fLCocoYKokzFnZCulZhO+ouw=; b=0ZdYxZLot3Eq8AOSbrHzTdgXCmNmWQ5M4r5nd/RwwK0HPQ4UQFTAgoEt534vRBi0gS UL5+KpfLjAduBCpSL/wOmXLEHgQuXyr380pM9Fvbv9hUP5sX5apeNz3MIkZeflNM17WH K7bFVfeRprRGrgBAdG4GuVPRZtrlFWB/xI0One6Z+gniNYqaJOJ9Iuj8My8sEAebFs+k OqJHBu5ReN/E8ev1z1d7RtNRSHFzQGps6qWDUL1l9Ws9IeDVnkqSMBAL662+SaO/n1QW lQp1gdq3xhdUqx7udUjhL9XfM38mnwuw6IC777D+9sv4gHBvVjIze4Ljys1XlUlYH2cp YcpQ== 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 j73si11530559pge.263.2019.02.26.00.31.50; Tue, 26 Feb 2019 00:32:06 -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 S1726829AbfBZIaL (ORCPT + 99 others); Tue, 26 Feb 2019 03:30:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:48364 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725879AbfBZIaK (ORCPT ); Tue, 26 Feb 2019 03:30:10 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 95415AEF6; Tue, 26 Feb 2019 08:30:09 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id D951F1E156D; Tue, 26 Feb 2019 09:30:08 +0100 (CET) Date: Tue, 26 Feb 2019 09:30:08 +0100 From: Jan Kara To: Sahitya Tummala Cc: Jan Kara , tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: huge fsync latencies for a small file on ext4 Message-ID: <20190226083008.GC10991@quack2.suse.cz> References: <20190219135302.GB27420@quack2.suse.cz> <20190225051007.GA32651@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190225051007.GA32651@codeaurora.org> 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 Mon 25-02-19 10:40:07, Sahitya Tummala wrote: > On Tue, Feb 19, 2019 at 02:53:02PM +0100, Jan Kara wrote: > > One has to be really careful when using i_size like this. By the time the > > transaction is committing, i_size could have been reduced from the value at > > the time page writeback was issued. And that change will be journalled only > > in the following transaction. So if the system crashes in the wrong moment, > > user could see uninitialized blocks between new_size and old_size after > > journal replay. So I don't think your patch is really correct. > > > > Thanks Jan for the clarification on the patch. I agree with your comments. > > From that discussion, I think the problem that it is discussing is w.r.t > journal thread waiting for on-going active transaction updates to be done > and thus causing commit latencies. Yes. > And I think the proposal is to do not > hold any handle while extents are being mapped in ext4_map_blocks() but > defer it till IO is completely done. Yes, real block allocation and insertion in extent tree will happen after IO completion. > And with the new proposal since the inode will be added to > transaction->t_inode_list only after the IO is completed, there will be > no longer the need to do journal_finish_inode_data_buffers() in the journal > context and thus this problem also will not be observed? Is my understanding > correct, please clarify. Actually, with the new proposal, we can just completely stop adding inodes to transaction->t_inode_list. But otherwise you're right. Honza > > > Ted has outlined a plan how to get rid of data=ordered limitations [1] and > > thus also this problem. It is quite some work but you're certainly welcome > > to help out :) > > > > [1] https://www.spinics.net/lists/linux-ext4/msg64175.html -- Jan Kara SUSE Labs, CR