From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55B61C4332F for ; Mon, 5 Dec 2022 20:34:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C36978E0002; Mon, 5 Dec 2022 15:34:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BE6898E0001; Mon, 5 Dec 2022 15:34:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AADFA8E0002; Mon, 5 Dec 2022 15:34:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 9888C8E0001 for ; Mon, 5 Dec 2022 15:34:46 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 63A0B120BCE for ; Mon, 5 Dec 2022 20:34:46 +0000 (UTC) X-FDA: 80209406172.11.F494582 Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by imf29.hostedemail.com (Postfix) with ESMTP id 0EF2F120008 for ; Mon, 5 Dec 2022 20:34:45 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="pV6KI/HZ"; spf=pass (imf29.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.128.174 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670272486; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GeLGTXERGukeSNOQDu2YmR7uT9/qpiRMDyykHkleQ2o=; b=JR1/OxY9/j8pAVJXtIqhnO1n7ody2DKqUnlvL867VjPdFqw9g0424xb07UfG2hHPoCOpNo egsEvCxgXRvLcQzE+Au4RQwe43JAVvoW7S90jzxoFcACWMKFL1XeChMMVxzoZ3ZAZ45gZV LlnXsGPpBE3TTyRPOxnUS1irnCxuYIc= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="pV6KI/HZ"; spf=pass (imf29.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.128.174 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670272486; a=rsa-sha256; cv=none; b=PtDfrN6xt0A0eexKO21KJI1QhWA4BcetP73ut0YhMFg0vL5qNt9gRY/SVCnB18G3IO+zqo Ssn+/mP2U4r6CQNaL+ZTYjqeR5Z1BkHsicb7+VkKkVubkSRh6mh2aEzXRiIqS3SuZ9o3HW 8QuGQFUmC3oNIbPxiILbj27xsVRzvhw= Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-381662c78a9so130835217b3.7 for ; Mon, 05 Dec 2022 12:34:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GeLGTXERGukeSNOQDu2YmR7uT9/qpiRMDyykHkleQ2o=; b=pV6KI/HZBQddAaryd4yKdtAZIjXHM+fQOQl8vls8oCF/Y0syljnC36hzxgQFzf3t1W ZEfFPue68nbSQYyN45g3vyc1tKTsDhhDmdhY4NZzbyws1OLLs/EBYBCLeHMjUZ7AqQkG bPHpYPqJ1AEZL4uauJNarKOb8Kjs0EiXHDayRbW+LvH0eVfIfd+Kt4GAhbisw/fJv8H5 ye4ctWjmmYNQlCsceyNtIQIp7VQQPqFfnpnwbiE6A67xPTrxsvIZPcz5N+C3swPGuMEV zdL6BSwaRQTncT/q4vMGhtHQUJU0KVbms8kPcPSjUkErq0sjFtA3tGrr1dDn23Y/Q2aR UEOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GeLGTXERGukeSNOQDu2YmR7uT9/qpiRMDyykHkleQ2o=; b=KlC32T5V+ikhnnCkIFjH2vRSXZidt0+quHstygMKMAifSxr9yPr+5DS/tR5BwfxNCV f18RTL4AkrpRYwGQGMLpC3vkbrOPd0AarqGajK2UzEPwqzNCdQcsiec5ZjIim+saFQER m70SFUwyzeWTY8kP36cggQ/VwwTu03dBLIhiv1sAnv7Y7eB+RPbQZLjWJxIRREyfWFGx y6K8H+c+Yssp9pt7qsxm+U3EBBW/ueSxjDUlB2xOkNJGiH/WjQwFMb6X4YIbGEYWrr4A GGAHqKyl04LCDzYohL8mEs8hJy0+hS5HV/6VSDoyQINi6opEYJXrfRqq6Z70zWmrundF dHqA== X-Gm-Message-State: ANoB5pkZt6lAG/Xf0vxmpSiC5KNMKscyzi7lrHvFILzyITy175xkC+kd G2hdrKEkK82KA3eylaS7ZZWHMK8lsxNCWV9CrU8= X-Google-Smtp-Source: AA0mqf6gVcUjGEuTNRozrYnWxY5uXjxRLCGPLpX8tEkUr/ot069nsH0uaNB29RtGgsmUEgc5iySKcYLMmK606QxvYxY= X-Received: by 2002:a81:4905:0:b0:3a8:fad9:13c0 with SMTP id w5-20020a814905000000b003a8fad913c0mr60110141ywa.23.1670272485151; Mon, 05 Dec 2022 12:34:45 -0800 (PST) MIME-Version: 1.0 References: <20221017202451.4951-1-vishal.moola@gmail.com> <20221017202451.4951-15-vishal.moola@gmail.com> <9c01bb74-97b3-d1c0-6a5f-dc8b11113e1a@kernel.org> In-Reply-To: From: Vishal Moola Date: Mon, 5 Dec 2022 12:34:33 -0800 Message-ID: Subject: Re: [f2fs-dev] [PATCH v3 14/23] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag() To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org, fengnan chang , linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0EF2F120008 X-Stat-Signature: fgtrd88xjmkjgtis8i54mz6dacmmaa3j X-Rspam-User: X-Spamd-Result: default: False [-1.90 / 9.00]; BAYES_HAM(-6.00)[100.00%]; SORBS_IRL_BL(3.00)[209.85.128.174:from]; SUBJECT_HAS_UNDERSCORES(1.00)[]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; RCVD_NO_TLS_LAST(0.10)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(0.00)[gmail.com,none]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; FROM_HAS_DN(0.00)[]; R_DKIM_ALLOW(0.00)[gmail.com:s=20210112]; TAGGED_FROM(0.00)[]; TO_DN_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[linux-mm@kvack.org]; R_SPF_ALLOW(0.00)[+ip4:209.85.128.0/17:c]; ARC_NA(0.00)[] X-Rspamd-Server: rspam08 X-HE-Tag: 1670272485-577392 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Nov 22, 2022 at 6:26 PM Vishal Moola wrote: > > On Mon, Nov 14, 2022 at 1:38 PM Vishal Moola wrote: > > > > On Sun, Nov 13, 2022 at 11:02 PM Chao Yu wrote: > > > > > > On 2022/10/18 4:24, Vishal Moola (Oracle) wrote: > > > > Converted the function to use a folio_batch instead of pagevec. This is in > > > > preparation for the removal of find_get_pages_range_tag(). > > > > > > > > Also modified f2fs_all_cluster_page_ready to take in a folio_batch instead > > > > of pagevec. This does NOT support large folios. The function currently > > > > > > Vishal, > > > > > > It looks this patch tries to revert Fengnan's change: > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=01fc4b9a6ed8eacb64e5609bab7ac963e1c7e486 > > > > > > How about doing some tests to evaluate its performance effect? > > > > Yeah I'll play around with it to see how much of a difference it makes. > > I did some testing. Looks like reverting Fengnan's change allows for > occasional, but significant, spikes in write latency. I'll work on a variation > of the patch that maintains the use of F2FS_ONSTACK_PAGES and send > that in the next version of the patch series. Thanks for pointing that out! Following Matthew's comment, I'm thinking we should go with this patch as is. The numbers between both variations did not have substantial differences with regard to latency. While the new variant would maintain the use of F2FS_ONSTACK_PAGES, the code becomes messier and would end up limiting the number of folios written back once large folio support is added. This means it would have to be converted down to this version later anyways. Does leaving this patch as is sound good to you? For reference, here's what the version continuing to use a page array of size F2FS_ONSTACK_PAGES would change: + nr_pages = 0; +again: + nr_folios = filemap_get_folios_tag(mapping, &index, end, + tag, &fbatch); + if (nr_folios == 0) { + if (nr_pages) + goto write; + goto write; break; + } + for (i = 0; i < nr_folios; i++) { + struct folio* folio = fbatch.folios[i]; + + idx = 0; + p = folio_nr_pages(folio); +add_more: + pages[nr_pages] = folio_page(folio,idx); + folio_ref_inc(folio); + if (++nr_pages == F2FS_ONSTACK_PAGES) { + index = folio->index + idx + 1; + folio_batch_release(&fbatch); + goto write; + } + if (++idx < p) + goto add_more; + } + folio_batch_release(&fbatch); + goto again; +write: > How do the remaining f2fs patches in the series look to you? > Patch 16/23 f2fs_sync_meta_pages() in particular seems like it may > be prone to problems. If there are any changes that need to be made to > it I can include those in the next version as well. Thanks for reviewing the patches so far. I wanted to follow up on asking for review of the last couple of patches.