Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18923095rwd; Wed, 28 Jun 2023 02:32:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6lmI7k573DTSDvmxhpMVu+tNphxgcbjSMJWrQe6YsWrGznJdzdvSmyitzyWtJOr1iMr1Lw X-Received: by 2002:a05:6808:120a:b0:39e:b985:b47e with SMTP id a10-20020a056808120a00b0039eb985b47emr40282777oil.36.1687944769628; Wed, 28 Jun 2023 02:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687944769; cv=none; d=google.com; s=arc-20160816; b=g4TRcptiH/gxbFjD2Tk9ZyYQpgzq7aJE12q3kgNcoZACibHNCcVCOGRF7pz6Jt/fbh 222BO4PJ5OhAE+gkEJU8TjxJT9iJ1ZagJDYSiwD/P+6wk9mBrTAR+AOV2mq8xqL4jHZ1 fP3Dld5GjT0NwkDqpIi/pO8C0BVLZZmnfhyL5FucyFzNsZbFYLYuobhTNku5yTJ2Usov E+H5S2yuQQdsQVTlS3yuSmuGNYnyz4DRC46WlYc265hEsvJCX/jjIUtX3KciEolYa5O6 LT5FNY1hK/mD60XYhh3IC+JDFsHgKgxefxtiXAWQvsjUjueMQZh6qdrDvvF3LZtMY1ju f9Kw== 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=O1waEYIxLL8AbYuL0wstgmIEKNw9jlwtFL4a/t+JvGQ=; fh=zGhwasWzh7GO58Vo1dKHnP8HJQLeggVlpkLUCV6dfzs=; b=XGWpJOFHwSPvvFlW5Co02NTWb2qY5DPhqHbxWowIHcgf+9YidXkWwRw5eB3dw+r2QA PEH2xGFYcs6Gor8rGrhrwjfXoZW430UOH+kdSR7ZAl7k/nWPOygxU9+QBBJK83frfda2 1/POZieFYiyOu6fm7gEw2djA/JRuiDP7McO/22hYPATkq59MA2YDcsblmKS3PfLTf5SF nF4W5kAE7TYzp10tJyIVzEeyttX76UjRB7MmZEhWRsZUdL2TjlLfLQX4s7poNDZnkQC6 jhMKkfrRmykTLr1Mj5GmF1z9/RI00oKMVUTtH0XMnqgLSOcnjpAbheKnfFknkjf5svip kNBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hayA+KhD; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 i184-20020a6387c1000000b0053eedcc504esi8782394pge.373.2023.06.28.02.32.36; Wed, 28 Jun 2023 02:32:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=hayA+KhD; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232797AbjF1J1m (ORCPT + 99 others); Wed, 28 Jun 2023 05:27:42 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:48346 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237598AbjF1JKp (ORCPT ); Wed, 28 Jun 2023 05:10:45 -0400 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-out1.suse.de (Postfix) with ESMTPS id 74C482185A; Wed, 28 Jun 2023 09:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1687943444; 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=O1waEYIxLL8AbYuL0wstgmIEKNw9jlwtFL4a/t+JvGQ=; b=hayA+KhDuNYXEyswHzkGwOL2lhBRMmyRk+LcUgh0Q32eHNRZIxP6ck3rM00MQVWtyrFsc7 ZVJ+rDturDkE4X9g1SVUDTPET1+5Kps545NkSgrMCD43J9W1vsieWiwaZospIHmqk8mWFG 4Mdp/eIp2kzvTjOLstxTJt0fM23YWn0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1687943444; 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=O1waEYIxLL8AbYuL0wstgmIEKNw9jlwtFL4a/t+JvGQ=; b=SUnqEokIdXZ9WjUuqjaF638pO3hMZYvR/dHxJIBy7/uzTkTrZj1TBi5QIXh0KE/LVXY17s qRR0HpgsxcFnPcDg== 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 687D7138E8; Wed, 28 Jun 2023 09:10:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Ulp7GRT5m2QEcAAAMHmgww (envelope-from ); Wed, 28 Jun 2023 09:10:44 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id E991BA0707; Wed, 28 Jun 2023 11:10:43 +0200 (CEST) Date: Wed, 28 Jun 2023 11:10:43 +0200 From: Jan Kara To: Matthew Wilcox Cc: Christoph Hellwig , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , David Howells Subject: Re: [PATCH 09/12] writeback: Factor writeback_iter_next() out of write_cache_pages() Message-ID: <20230628091043.lokcx4tdbwxisk7a@quack3> References: <20230626173521.459345-1-willy@infradead.org> <20230626173521.459345-10-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 27-06-23 16:31:17, Matthew Wilcox wrote: > > > + if (error == AOP_WRITEPAGE_ACTIVATE) { > > > + folio_unlock(folio); > > > + error = 0; > > > > Note there really shouldn't be any need for this in outside of the > > legacy >writepage case. But it might make sense to delay the removal > > until after ->writepage is gone to avoid bugs in conversions. > > ext4_journalled_writepage_callback() still returns > AOP_WRITEPAGE_ACTIVATE, and that's used by a direct call to > write_cache_pages(). Yeah. For record ext4_journalled_writepage_callback() is a bit of an abuse of writeback code by ext4 data=journal path but it seemed like a lesser evil than duplicating write_cache_pages() code. Essentially we need to iterate all dirty folios and call page_mkclean() on them (to stop folio modifications through mmap while transaction commit code is writing these pages to the journal). If we exported from page writeback code enough helpers for dirty page iteration, we could get rid of ext4_journalled_writepage_callback() and its AOP_WRITEPAGE_ACTIVATE usage as well. Honza -- Jan Kara SUSE Labs, CR