Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1023678rwb; Wed, 16 Nov 2022 10:50:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4qDXgUiOdii7FTlTfpjZ2JQyYWqUFp5z4s9IK6lEiKloksu6yZ+COdg2VhuBALE6ZkE/iD X-Received: by 2002:a17:906:abc6:b0:7ac:db50:90ed with SMTP id kq6-20020a170906abc600b007acdb5090edmr18852303ejb.487.1668624620722; Wed, 16 Nov 2022 10:50:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668624620; cv=none; d=google.com; s=arc-20160816; b=zrmDyTwgRqg8q95UFYV87HuBxVOycy8DlRzeB0flniAk6WZfjHddzuotKhblWfAy6i 2Ejgpss93ehkcOaxBOx1KldQmth05QIor315wqPhhpasYTkabBezm6FH4Aqkdt1ibCKr et6woK07hI1NGhfjhl4ZyU/4v4i6pp/My6At02yQe/94oIh2EUxuDH6o6RWu8CyjIQjZ qYhSfyssl6nZp0QKNTDtfcGn5pE/deGqkUElyDrJBaOjUJv14Psg/NOJ1cJyvqyrpkPF HOqItkRZTSmWGxEy4Oh0CyUpwKX/mrfpS9K54yUteSZdxBvNmDQeDztFYAoJQsgLbs8A HIZg== 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; bh=hYF3Hj9rSyQp4X4qzG1/mtul7nlvlXjBvw9fIIZhTos=; b=AYbLwUjAtd/o/bMX3D2p/4lk7zxO28asULsl8k/hD3uDwNXFgr9EXiXt2GdGqDuKuK KNDKOaM9nTM+0qP/uKwE3BWP69BKs50x3Y04usqV29TnRnQVZdWDCHe+4tG5mrx0Bef7 YOPv1eX4APNEeA0rrLNKkbYuBh2ifRUEliYMnszZEIo1hVN679gpkVM92hGvnLpNn+Cz /fulUri0m8kVRDU1hoatAK2bddhvTxTDuwhPiDeDAL9AEEU9pt5IitAE07S462Wz3EBE QUzSUVT62fYrIk9wUm2w35u9iZ0T2KQ2wRGBIphzWgIS0eaStKL3UxXJmHtIFMdqGuq0 cD7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="X/3VlFQO"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a1709063a0400b00780837381d8si11019565eje.591.2022.11.16.10.49.53; Wed, 16 Nov 2022 10:50:20 -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=@gmail.com header.s=20210112 header.b="X/3VlFQO"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233555AbiKPSjL (ORCPT + 99 others); Wed, 16 Nov 2022 13:39:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234560AbiKPSjJ (ORCPT ); Wed, 16 Nov 2022 13:39:09 -0500 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5A2D2A70E; Wed, 16 Nov 2022 10:39:07 -0800 (PST) Received: by mail-pf1-x42b.google.com with SMTP id b185so18265973pfb.9; Wed, 16 Nov 2022 10:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=hYF3Hj9rSyQp4X4qzG1/mtul7nlvlXjBvw9fIIZhTos=; b=X/3VlFQOq/F4K880LRk9TjjvLSZlvu7/kRCnM9p5B3rYiLfewmE7LcvkodiAPiM7DU raLagsEw7CdstzIfRRDQz9Le/ayij3LC1LTJRZHZxZkqIdDJj+AgU3FGWfWpEYNI63hd JHT6SvBQ94N/ok8vRWKDzFTw0PvRImdHoqK9ezlfgiLhWQpzYE91xtGeyNwOlJistHMc UGjhbEzpM/cIjmxjL/mrzcDHpeePSLDv0f7N4d6JVNznieNE4hs4/NJOZBhlox3hzYej zUlZxtCAbtrkFHhBGxuKAuuS96kObNhGGMwm9Pv+FlRMqdlXaO+8r+jE/zxwLpwZYYsk NOPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hYF3Hj9rSyQp4X4qzG1/mtul7nlvlXjBvw9fIIZhTos=; b=JABuWZBbFW69CwWffnn5zErKb4qbKaqWrJDXR6Cmk7QDJvSczkThiYTfcsoJ3Br1rx yiW07bWmIBLEsKieN88VAlSUyA7EhSML06STtmTgMzM7OWGz/8c8Ebu9LBfCSjjdNuD2 M28IgoTTuhozg9zjYUCyOnMT/TMR5y6+VG6aZNQFouAwKodhFRVPt+V/Ua4uGUzSphyg 6IukrLOdN1l5QMfZoE74uoBrFa1WQ9fsD3gKTLRd4O3n5i97ycaFB/OTDtPEtekGSoE7 xXXLeYLhrf1Vt0EpSNKtxyWzHg0VCJOEVBl0jibSI7YJl+oMmk86FNLnPGmwtmNrMgGG aN7g== X-Gm-Message-State: ANoB5plSV5mQjnOT61f/31D49pkClKNRcriJEiYnVGlIsyPO6oi1AuID GFaaQS/F7u0uLmTCSKMw7qY= X-Received: by 2002:a62:1ad4:0:b0:56b:add7:fe2f with SMTP id a203-20020a621ad4000000b0056badd7fe2fmr24188517pfa.51.1668623947228; Wed, 16 Nov 2022 10:39:07 -0800 (PST) Received: from localhost ([2406:7400:63:f20b:f6ca:e236:f59f:8c18]) by smtp.gmail.com with ESMTPSA id a4-20020aa795a4000000b0056d7cc80ea4sm11234366pfk.110.2022.11.16.10.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 10:39:06 -0800 (PST) Date: Thu, 17 Nov 2022 00:09:00 +0530 From: "Ritesh Harjani (IBM)" To: Christoph Hellwig Cc: Namjae Jeon , Sungjong Seo , Jan Kara , OGAWA Hirofumi , Mikulas Patocka , Dave Kleikamp , Bob Copeland , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-karma-devel@lists.sourceforge.net, linux-mm@kvack.org Subject: Re: start removing writepage instances Message-ID: <20221116183900.yzpcymelnnwppoh7@riteshh-domain> References: <20221113162902.883850-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221113162902.883850-1-hch@lst.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 22/11/13 05:28PM, Christoph Hellwig wrote: > Hi all, > > The VM doesn't need or want ->writepage for writeback and is fine with > just having ->writepages as long as ->migrate_folio is implemented. Ok, so here is, (what I think) is the motivation for doing this. Please correct me if this is incorrect... 1. writepage is mainly called from pageout, which happens as part of the memory reclaim. Now IIUC from previous discussions [1][2][3], reclaims happens from the tail end of the LRU list which could do an I/O of a single page while an ongoing writeback was in progress of multiple pages. This disrupts the I/O pattern to become more random in nature, compared to, if we would have let writeback/flusher do it's job of writing back dirty pages. Also many filesystems behave very differently within their ->writepage calls, e.g. ext4 doesn't actually write in ->writepage for DELAYED blocks. 2. Now the other place from where ->writepage can be called from is, writeout() function, which is a fallback function for migration (fallback_migrate_folio()). fallback_migrate_folio() is called from move_to_new_folio() if ->migrate_folio is not defined for the FS. So what you are doing here is removing the ->writepage from address_space operations of the filesystems which implements ->writepage using block_write_full_page() (i.e. those who uses buffer_heads). This is done for those FS who already have ->migrate_folio() implemented (hence no need of ->writepage). ...Now this is also a step towards reducing the callers from kernel which uses buffer_heads. [1]: https://lore.kernel.org/all/1310567487-15367-1-git-send-email-mgorman@suse.de/ [2]: https://lore.kernel.org/all/20181107063127.3902-2-david@fromorbit.com/ [3]: https://lore.kernel.org/all/1271117878-19274-1-git-send-email-david@fromorbit.com/ Is above a correct understanding? > > This series removes all ->writepage instances that use > block_write_full_page directly and also have a plain mpage_writepages > based ->writepages. Ok. > > Diffstat: > fs/exfat/inode.c | 9 ++------- > fs/ext2/inode.c | 6 ------ > fs/fat/inode.c | 9 ++------- > fs/hfs/inode.c | 2 +- > fs/hfsplus/inode.c | 2 +- > fs/hpfs/file.c | 9 ++------- > fs/jfs/inode.c | 7 +------ > fs/omfs/file.c | 7 +------ > fs/udf/inode.c | 7 +------ > 9 files changed, 11 insertions(+), 47 deletions(-)