Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp445311rwb; Thu, 1 Dec 2022 04:21:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf4K2C10l7ZVBWM4deUVu615QsvvE30niF3WrKCEPSUQSRGzdGOkYVRULAM4nox/Shg6G5f5 X-Received: by 2002:a63:5016:0:b0:478:538a:aec6 with SMTP id e22-20020a635016000000b00478538aaec6mr9430149pgb.290.1669897310950; Thu, 01 Dec 2022 04:21:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669897310; cv=none; d=google.com; s=arc-20160816; b=TtE/3FkRe0WbyPUMZaagZQXGnl8BW78CVpmaN34ljmYZ4mgsELHGvnehyTfWcTydy8 utnStqo827pg6H4ksTAedf6E5EdnxnleZezL1nYA4HKMli1D7YO2czQ+XkNWoKVtBm3A uRMDWPvm+vmLzC/fdoEG0j0XRYCktpK1AxpFLlmNtZ4c6gpBr8vnAyNASDbamumAkKbA TD7+NgWTmUa81RWJcZqhq9FyamDkHKAHqx1Rc2HdVkdG+JO9CpaAdZKEPH9hHrjEpviB QMspY2wtfi+/+ErIt+ySWWS6VicsvNspPIeRXT4cmnUoJFbt8LdVsoOKJ4Q6ZxPHAZU/ 7BNQ== 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 :dkim-signature; bh=aIuShHQJX6ATEISDVtU+qPEVcr3dd3SVEuuk3k3nxoE=; b=F7IUp38y8nAm4yDG012tkCCYmSk9s21mXKJ2WoLOba/oXLfEnCcEO5Jd4Su/Jw/mpt JAHawjMXHVb6l7xYAm5en4LhCa1gCXaeymAV3eYmbFCAlbUlD7ItDhKZGivQzUUF77Q3 34iRWWnbtxjmIGxyIWBbpai/ry/N8RaQ72iQb9iUlfALPLgKhwzHKFRtoUDPXz2BYLfI 1ByYlsB89UQ5+ZX9DJqdAive1BHb1EhHSY5+sZXrh5Lj0vlTph3BsZ9SHkMZifBFQUpH C+vGRqyLm5SF9CkiFjyg7OTAOwj3HrIH2/zJoeG95kxlxz3EpfsgSwqlg/ofpGaSfarv hAwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=DFPLAiT0; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ET5XSBNv; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a056a00089100b0056ce7a12b25si5000978pfj.137.2022.12.01.04.21.30; Thu, 01 Dec 2022 04:21:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-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=@suse.cz header.s=susede2_rsa header.b=DFPLAiT0; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ET5XSBNv; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbiLALzN (ORCPT + 99 others); Thu, 1 Dec 2022 06:55:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231225AbiLALzH (ORCPT ); Thu, 1 Dec 2022 06:55:07 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 965A84EC0C for ; Thu, 1 Dec 2022 03:55:02 -0800 (PST) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4D02B1F7AB; Thu, 1 Dec 2022 11:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1669895701; h=from:from:reply-to: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=aIuShHQJX6ATEISDVtU+qPEVcr3dd3SVEuuk3k3nxoE=; b=DFPLAiT0o2QIEsN58j7Mri3eHbzhkRW1hO7jlELU+p8mYgYyFQr7EmUH72TBSlyPLpNkBi JDigwFYAZuwU4ou31TimLaK59Z8VDcal3JKCF6et7uQHLfPRUoHCIKGM5iv1aQfP9ep7fq esKGbDiWn8zcYmkEzP3lLcxslwoIS2o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1669895701; h=from:from:reply-to: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=aIuShHQJX6ATEISDVtU+qPEVcr3dd3SVEuuk3k3nxoE=; b=ET5XSBNvEULzDr+j2jCmzVAxXFV4QMldJkOkjvhp9EkMs0kkGcCDhMVzIidJlhpItYOO0H fHSZBSTZ9PIbB7CA== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 3F7CA1320E; Thu, 1 Dec 2022 11:55:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id 1mF6DxWWiGPdXAAAGKfGzw (envelope-from ); Thu, 01 Dec 2022 11:55:01 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id CCAA0A06E4; Thu, 1 Dec 2022 12:55:00 +0100 (CET) Date: Thu, 1 Dec 2022 12:55:00 +0100 From: Jan Kara To: "Ritesh Harjani (IBM)" Cc: Jan Kara , Ted Tso , linux-ext4@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH 0/9] ext4: Stop using ext4_writepage() for writeout of ordered data Message-ID: <20221201115500.kbxtteft3v4pzqqx@quack3> References: <20221130162435.2324-1-jack@suse.cz> <20221201114205.mg6song3ulrqvt54@riteshh-domain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221201114205.mg6song3ulrqvt54@riteshh-domain> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL 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-ext4@vger.kernel.org On Thu 01-12-22 17:12:05, Ritesh Harjani (IBM) wrote: > On 22/11/30 05:35PM, Jan Kara wrote: > > Hello, > > > > this patch series modifies ext4 so that we stop using ext4_writepage() for > > writeout of ordered data during transaction commit (through > > generic_writepages() from jbd2_journal_submit_inode_data_buffers()). Instead we > > directly call ext4_writepages() from the > > ext4_journal_submit_inode_data_buffers(). > > Hello Jan, > > Do you think we should add a WARN_ON_ONCE() or something in > ext4_do_writepages() function where we might try to start a transaction > at [J]. Since we can now enter into ext4_do_writepages() from two places: > 1. writeback > 2. jbd2_journal_commit_transaction() > mpage_submit_page > mpage_prepare_extent_to_map > ext4_do_writepages > ext4_normal_submit_inode_data_buffers > ext4_journal_submit_inode_data_buffers > journal_submit_data_buffers > jbd2_journal_commit_transaction > kjournald2 > > So IIUC, we will call mpage_submit_page() in the first call to > mpage_prepare_extent_to_map() [1] itself. That may set mpd->scanned_until_end = 1 > at the end of it. So then we should never enter into the while loop where we > start a journal txn. Yes, correct. But I agree a WARN_ON_ONCE in the loop might be useful just in case. I'll add it. Thanks for the idea. Honza -- Jan Kara SUSE Labs, CR