Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp76825rdb; Thu, 21 Dec 2023 03:22:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFK5oyvrQ39ZlWg6jK3B38mkkISTT/Ca2hz3K+dkFZMHzbQ/oFDOmfdTYiMtxz9s6kwa6Ai X-Received: by 2002:a05:6e02:1c88:b0:35f:722a:8b0a with SMTP id w8-20020a056e021c8800b0035f722a8b0amr16579932ill.63.1703157740056; Thu, 21 Dec 2023 03:22:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703157740; cv=none; d=google.com; s=arc-20160816; b=w6PTCzRPsOctLuPh0Ty9Jf/yih76aPvemXY0mYS54xJmSSdKNTp9fWsXVRvGGVUx3F edC/xQ42ca0ZT8PPTZ6AvOolHp+5Dl5orPfxGdhJmvbFSUyf6QBoIMa2JE6wMnhHjKni uqoXhmMH9pNCsWuHnWuRHC+2YWhpK0Pz0LGp+msdRtvM8R1zNkO+pkTGCNjeAIcRyOuR ozqQOAfYLFXG3mhi+KlYXEi9/Gni/C5Z0wcue1SBzhKDGkYZlB93CHMbHk5gnxAKeCuV ZEYv+NJo3lOAsGwc0/xSb1GmIz4JoSL0+phSJpPqxG9chs6c9zxgfHtcy/RA9Ddpzsgh AcjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=pi7hRIwpboX5Xu7y0qd/z2bmAu98D1+xyAumfJmNvK4=; fh=i6rGHk/clC1f9Y4mpJyYVOWW6p98QflrI/jjeassMJc=; b=kuBNcOoHGsJEF1V7u9yK3mycM/SXTucX7C8jI1M4ZBoAd0g99HTtn42l85GbEK8lIE AtvJ+y5Sx/nxz4FGUT1W3j0FIYcyNf7gtPFJZgzZ850SfbjQNFVjtnlMzjSZEuiFSQuM xBnGHbkdXMuSMwLAFwE34GmXAJl6NgaMsG8GyOa2/CeXdOSeOjnARKO9Hm32L23FiCo9 isqRBXnOWR9VuMQOAS+bukTAPmzN9gqkgYOyPqB6b3JxA1rx69Zwqhqfb3LYam0QBV7g qQYAsPhac4MFJHHTpyEQmsX5byNXcDvNlzkMBrS4mEYgBiTEfkgChrFJqvae+cYcvVkx CWPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=kMpzL+ie; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=kMpzL+ie; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel+bounces-8273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8273-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e6-20020a656486000000b005be00724141si1369397pgv.533.2023.12.21.03.22.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 03:22:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=kMpzL+ie; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=kMpzL+ie; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel+bounces-8273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8273-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ACCC328567E for ; Thu, 21 Dec 2023 11:22:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FEB56BB55; Thu, 21 Dec 2023 11:22:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="kMpzL+ie"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="p2fc/wre"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="kMpzL+ie"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="p2fc/wre" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1FFE34555; Thu, 21 Dec 2023 11:22:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B3D9721DC8; Thu, 21 Dec 2023 11:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1703157726; 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=pi7hRIwpboX5Xu7y0qd/z2bmAu98D1+xyAumfJmNvK4=; b=kMpzL+ie++zLwCkwHGBQZ0WX2Gtuv7hgYuCZ0BhNBsVV6zvtNObGFQIrhNqcX+IvGwC9gy WbJkETUtT9ZHa3nSXEF2fsB5ByEnOTO6SDIzSYPs3INMzBSLMvPlqqVy50lOjwrBuM2rP6 vApsEVVPzlqlu6597SCPrUsb3b86M3I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1703157726; 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=pi7hRIwpboX5Xu7y0qd/z2bmAu98D1+xyAumfJmNvK4=; b=p2fc/wreu6wuPV676GJ09229hWhN15CuWbvMvuLxXIG/cGFw5zxXYvdFQIAJu+M5o1hu49 8+WjvyTVxHRH8KBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1703157726; 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=pi7hRIwpboX5Xu7y0qd/z2bmAu98D1+xyAumfJmNvK4=; b=kMpzL+ie++zLwCkwHGBQZ0WX2Gtuv7hgYuCZ0BhNBsVV6zvtNObGFQIrhNqcX+IvGwC9gy WbJkETUtT9ZHa3nSXEF2fsB5ByEnOTO6SDIzSYPs3INMzBSLMvPlqqVy50lOjwrBuM2rP6 vApsEVVPzlqlu6597SCPrUsb3b86M3I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1703157726; 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=pi7hRIwpboX5Xu7y0qd/z2bmAu98D1+xyAumfJmNvK4=; b=p2fc/wreu6wuPV676GJ09229hWhN15CuWbvMvuLxXIG/cGFw5zxXYvdFQIAJu+M5o1hu49 8+WjvyTVxHRH8KBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A7E7113725; Thu, 21 Dec 2023 11:22:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id GpX7KN4fhGVmWQAAD6G6ig (envelope-from ); Thu, 21 Dec 2023 11:22:06 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 5C2B6A07E3; Thu, 21 Dec 2023 12:22:06 +0100 (CET) Date: Thu, 21 Dec 2023 12:22:06 +0100 From: Jan Kara To: Christoph Hellwig Cc: linux-mm@kvack.org, "Matthew Wilcox (Oracle)" , Jan Kara , David Howells , Brian Foster , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/17] writeback: Factor should_writeback_folio() out of write_cache_pages() Message-ID: <20231221112206.f6biqpkpwl6w64mo@quack3> References: <20231218153553.807799-1-hch@lst.de> <20231218153553.807799-9-hch@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231218153553.807799-9-hch@lst.de> X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-1.89 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[8]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-2.08)[95.51%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:dkim,suse.cz:email,suse.com:email,lst.de:email,infradead.org:email]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from] Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=kMpzL+ie; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="p2fc/wre" X-Spam-Score: -1.89 X-Rspamd-Queue-Id: B3D9721DC8 On Mon 18-12-23 16:35:44, Christoph Hellwig wrote: > From: "Matthew Wilcox (Oracle)" > > Reduce write_cache_pages() by about 30 lines; much of it is commentary, > but it all bundles nicely into an obvious function. > > Signed-off-by: Matthew Wilcox (Oracle) > Signed-off-by: Christoph Hellwig One nit below, otherwise feel free to add: Reviewed-by: Jan Kara > +static bool should_writeback_folio(struct address_space *mapping, > + struct writeback_control *wbc, struct folio *folio) > +{ I'd call this function folio_prepare_writeback() or something like that to make it clearer that this function is not only about the decision whether we want to write folio or not but we also clear the dirty bit & writeprotect the folio in page tables. Honza -- Jan Kara SUSE Labs, CR