Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp819745rwl; Wed, 29 Mar 2023 08:53:44 -0700 (PDT) X-Google-Smtp-Source: AKy350bhYxQgdE1V9qdujOvVFv46eieB7NX97RHdGCQiTnq+PepauRXu7cH0W5qhr4Fb6PAH19A5 X-Received: by 2002:a17:906:25d1:b0:8b1:3131:76e9 with SMTP id n17-20020a17090625d100b008b1313176e9mr20448361ejb.46.1680105224752; Wed, 29 Mar 2023 08:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680105224; cv=none; d=google.com; s=arc-20160816; b=FLCZv/Ok2SB6uyX9sbu/yBTqmThfge9tIM1RTnyQC4pXSsm94Q9JCr6zXqDkDXBZ/3 jfpIkIc7PkJAXJSKjK9ScnU4pSMUdFQq7dlXscvcVXQhKqEBVC9/3JRav0W9L+kLd6Ni nVZ893fvuNqCY3VtPuF2YDRNfZOvWczM2RitRgkLxa1Qtsd+wRCwWkeJmlt4svu686u3 IbN+N9csx+XmDmxxnqZO7QgOpv2/TMCih+6DGGwk0Lzm7pYy1qeLUHCyUooiW70tM9bD scgKq5L2B44dY2JuutyXIbR200+Thp8K71EyStYtm8VhVszdxUJoe9GThGxPCBPVUNN9 8qAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=WwY1T459VMFvhOPvUbMAYHK0ApbyLxfkOlobMW3zAmY=; b=oD5AjIP6IrdNBomMmLMLufhhZou4NSr9ASKLRS8Jj/9fAOMPHKUKmoCNtodbZv2xBH D/6vqRCKIqrdt3kus4gA+zpqKK3AnsyMfdlgRZvrlkJYuxDed5spd20XShil0w0BUnSK Ayw+Ln6fwazmC7yA+B8K8RV28Pnia5BwwwiV1GiIBo3rSGBZzNHGjS8smdjTQeCXh36F L/G1GkWgAa1MTWA04evkrxDPcydin9k/kXohrICrBnbqrGka5oskDQOVHM/p53zWYmIl 6Yw6FS+LtOL2nwst7ace+jz42bVQrVOH4xr7xn6RBF1iDsWLvZxt3RqwaBekmZXUbVUJ Qlaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hhJJJAIQ; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ATuBKxCX; 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 lf30-20020a170907175e00b0093b06aa53fbsi18432843ejc.596.2023.03.29.08.53.17; Wed, 29 Mar 2023 08:53:44 -0700 (PDT) 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=hhJJJAIQ; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ATuBKxCX; 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 S230200AbjC2Pt6 (ORCPT + 99 others); Wed, 29 Mar 2023 11:49:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjC2Pt5 (ORCPT ); Wed, 29 Mar 2023 11:49:57 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3C824690 for ; Wed, 29 Mar 2023 08:49:56 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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 781BD1FDFF; Wed, 29 Mar 2023 15:49:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1680104995; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WwY1T459VMFvhOPvUbMAYHK0ApbyLxfkOlobMW3zAmY=; b=hhJJJAIQwtO10IYST4CLsqgjdNO+rX/O1mdlDiJJEJqt+yqG7XFh9ceqcWOK8cMM1LhdFb DS509f0+cBqHTrsZ0t8jjA5F98dMFAyRHuPWIfUiiAT2tJd5tRNzfPrOky/IAvVSPKAHQ4 z3TSL5SaVjC7YRj2UkMDnnqOAHhnhmw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1680104995; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WwY1T459VMFvhOPvUbMAYHK0ApbyLxfkOlobMW3zAmY=; b=ATuBKxCXNqdTRPTLjW8WPX5AdfX3sBx6YM1UpCv80wbvewkjh208pFZZwiextcNho7oytA I0RmX2pYn7esyPDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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 imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C4C0F138FF; Wed, 29 Mar 2023 15:49:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Ri2SLyJeJGQwYwAAMHmgww (envelope-from ); Wed, 29 Mar 2023 15:49:54 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 298C5A071E; Wed, 29 Mar 2023 17:49:50 +0200 (CEST) From: Jan Kara To: Ted Tso Cc: , Jan Kara Subject: [PATCH 0/13 v1] ext4: Make ext4_writepages() write all journalled data Date: Wed, 29 Mar 2023 17:49:31 +0200 Message-Id: <20230329125740.4127-1-jack@suse.cz> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1247; i=jack@suse.cz; h=from:subject:message-id; bh=NA359qnZPj2j+lzgQd4wusi65HVFfFNfe4zWPNbQoes=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBkJF3zkarThMT06xwbLzqXVkO2aGh/HSZUmpaDFwPF Uo5a7PWJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZCRd8wAKCRCcnaoHP2RA2ZhcB/ 0bXnYSO34G4WbT4GpYy8alsOh3qEEv8T21qH0REOkk3nonTmOu3fqK2no8Z4hDMmCuJWfPmdSGCMcP +zcI2lucd8Af1i/qN38HYKlKpsvz09z3Fjy2Hr1J8Qa+tUlD/GJ1/BmZcohFksHSFA1abiMtjhGiBr E4I5t6PF/q0m8m8kA4EBuN2pVoRjlRQpUc2DF69N7yMPvFvsr6nn4E/3tTdoz1AnzEHmcMCY6sOCUK TJeTyWzhyXmfkgWmb0r306cDA+zg2nktghQ/3ZcMFsq4OU4mI0DlFvH7+BhJORc80izGI/+ZI4FRah 1SkYcOFhHJOiZS6Y3rBV92GNDnjHpf X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=unavailable 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 Hello, These patches modify ext4 so that whenever inode with journalled data is written back we make sure we writeout all the dirty data the inode has. Previously this was not the case as pages with journalled data that were still part of running (or committing) transaction appeared as clean to the writeback code. As a result we can remove workarounds for inodes with journalled data from multiple places. In particular, we make sure a page is marked as dirty as soon as it has any data to write (even though it is part of the running transaction) and in ext4_writepages() we make sure appropriate transaction is committed (in WB_SYNC_ALL mode) and then go writing back pages (effectively performing a checkpoint for the inode). Thus after WB_SYNC_ALL writeback all pages for the inode are guaranteed to be clean (providing there were no new pages dirtied) the same way this is guaranteed for non-journaled data. The downside of this change is that workloads that use journalled data and frequently redirty pages and call fsync(2) will see more IO happening (more pages will get checkpointed). But given low amount of users of data=journal mode and their nature, I deem the code simplification worth it. Honza