Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1446027rwb; Wed, 7 Dec 2022 13:16:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf4xk3VVg226snK/hzszwi9b4827Yh6AT9f3PyOa0tcASmkJP2YnAu82ATxn7oDXgXpQF+71 X-Received: by 2002:a50:eb8f:0:b0:46c:5a22:b00c with SMTP id y15-20020a50eb8f000000b0046c5a22b00cmr17781145edr.46.1670447763172; Wed, 07 Dec 2022 13:16:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670447763; cv=none; d=google.com; s=arc-20160816; b=0vrbjYcwHR6KkARzrpRuLlJXXZzGNra4jc6Mz+VwD+sLmKFT+BMLmC8tkLVzkl74bv K/4a1hEKM4vK+yt0bCrDYgLRcLsXyYmGPBcJEuxPHYuhFUrwZkLA5kCowbwBrPxxnqaG TYY6wzzO7bJsXZumr4Z2ihFUhTrcHEid5ftkR5VYc0u3v8+EVsmWoYp1OLsqSjdCmNTZ Um8CaKsgQrA49KJygN/mur8dLH/xcDu0cNDpxZ8NTL1WWhjPn3xQWGYtdeOsrmRC9rge cEcOvPhvHMgJVzGXHBQufvpSTh9CBFckpCuyR/N4UOLPBiQaiLM4s5a978nyOdM2wJVY 8vMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=UORhhcQqOaIvpRwHi0DMFterbhwvG2EXcBZ82YBwQMU=; b=mhKwnoYlHpIRCbjZxBiHv3n/rkfj2v1zAPMOMdXAV/ZzEGc4TXT+2fkoqdcUyXPqz5 j8P+/LeJ8hjM5cnOR7rSkpZFOkWzrxYqyqJnE98ydcIfYeiCVfLf6rLnOcXCH3iAaG/D FP6oWP//7mwzEGAr4ePHRo4w4WDA8I8IhkHhoqLdFhSW/0Zc0XSiTZKfOII9oqYIXWJB +fcBHGVRFbxrmCF1NAw/rz7TeDYqSHibkvIq7NUakLiLl+X18H8bwB85rvlsZ8Szr70K wiIcVHItZBYpGqvPayM/RjP2eh48GW+WuPBNPbmz0U36dotEVd4UwxB6RJ0AjNaZjOv+ IL/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=HB0cbnty; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt13-20020a170907728d00b007c10e7a7628si4565863ejc.839.2022.12.07.13.15.40; Wed, 07 Dec 2022 13:16:03 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=HB0cbnty; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229715AbiLGUxO (ORCPT + 74 others); Wed, 7 Dec 2022 15:53:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbiLGUww (ORCPT ); Wed, 7 Dec 2022 15:52:52 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5D478139F; Wed, 7 Dec 2022 12:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UORhhcQqOaIvpRwHi0DMFterbhwvG2EXcBZ82YBwQMU=; b=HB0cbntyJzwuDFdxDCnp+Vlwhk tSONA7EaFAT9b+ZkRhi8SCpbuaWYeyV5dX92dXFFQy0XLTwjZ8b+qZwY47nxK7r2JS3AhDY/Y2q18 YQWeVOWuZLc56HAj71ksdMyTmxK6OQToCGUwu1P6WxiBWym+wp+/POSm1HgoJ8F5etqzNTjvaY9bB oumvoTFfM93KB+IZtwPw2qExrWTiQawM9qjY/9m+jEcmlrXCaa4To5UgSUoi6LVA0YsHiwMLJcwMm Txs6DUb29cPIuy/ivStLtb5yUJUpwXE8cCLBgzfJaZSs2U6XAo+6S6gBoGM5zgOeszjBtmgcza8E+ ms0w9KNw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p31Np-00CLcf-VD; Wed, 07 Dec 2022 20:51:14 +0000 Date: Wed, 7 Dec 2022 12:51:13 -0800 From: Luis Chamberlain To: Matthew Wilcox , Pankaj Raghav , Jaegeuk Kim Cc: Yangtao Li , chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, fengnanchang@gmail.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, vishal.moola@gmail.com, Javier =?iso-8859-1?Q?Gonz=E1lez?= , Adam Manzanares Subject: Re: [PATCH] f2fs: Support enhanced hot/cold data separation for f2fs Message-ID: References: <20221130124804.79845-1-frank.li@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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-kernel@vger.kernel.org On Wed, Nov 30, 2022 at 03:18:41PM +0000, Matthew Wilcox wrote: > On Wed, Nov 30, 2022 at 08:48:04PM +0800, Yangtao Li wrote: > > Hi, > > > > > Thanks for reviewing this. I think the real solution to this is > > > that f2fs should be using large folios. That way, the page cache > > > will keep track of dirtiness on a per-folio basis, and if your folios > > > are at least as large as your cluster size, you won't need to do the > > > f2fs_prepare_compress_overwrite() dance. And you'll get at least fifteen > > > dirty folios per call instead of fifteen dirty pages, so your costs will > > > be much lower. > > > > > > Is anyone interested in doing the work to convert f2fs to support > > > large folios? I can help, or you can look at the work done for XFS, > > > AFS and a few other filesystems. > > > > Seems like an interesting job. Not sure if I can be of any help. > > What needs to be done currently to support large folio? > > > > Are there any roadmaps and reference documents. > > >From a filesystem point of view, you need to ensure that you handle folios > larger than PAGE_SIZE correctly. The easiest way is to spread the use > of folios throughout the filesystem. For example, today the first thing > we do in f2fs_read_data_folio() is convert the folio back into a page. > That works because f2fs hasn't told the kernel that it supports large > folios, so the VFS won't create large folios for it. > > It's a lot of subtle things. Here's an obvious one: > zero_user_segment(page, 0, PAGE_SIZE); > There's a folio equivalent that will zero an entire folio. > > But then there is code which assumes the number of blocks per page (maybe > not in f2fs?) and so on. Every filesystem will have its own challenges. > > One way to approach this is to just enable large folios (see commit > 6795801366da or 8549a26308f9) and see what breaks when you run xfstests > over it. Probably quite a lot! Me and Pankaj are very interested in helping on this front. And so we'll start to organize and talk every week about this to see what is missing. First order of business however will be testing so we'll have to establish a public baseline to ensure we don't regress. For this we intend on using kdevops so that'll be done first. If folks have patches they want to test in consideration for folio / iomap enhancements feel free to Cc us :) After we establish a baseline we can move forward with taking on tasks which will help with this conversion. [0] https://github.com/linux-kdevops/kdevops Luis