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 43B57C64ED6 for ; Wed, 1 Mar 2023 10:36:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C290F6B0073; Wed, 1 Mar 2023 05:36:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BD8976B0074; Wed, 1 Mar 2023 05:36:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC7636B0075; Wed, 1 Mar 2023 05:36:03 -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 9D81C6B0073 for ; Wed, 1 Mar 2023 05:36:03 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 62D4E4158F for ; Wed, 1 Mar 2023 10:36:03 +0000 (UTC) X-FDA: 80519974206.07.18D8284 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf28.hostedemail.com (Postfix) with ESMTP id 9F470C0003 for ; Wed, 1 Mar 2023 10:36:01 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf28.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677666961; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=POtw02vLC95P+Vmuj2oNoDMWFBbTZxQmLqg8nHAKLWY=; b=jDuhJ6o2onos6argfcLuU/8b0T1kUYT1n9PrMfIebrwgELA6NpZgk4dDWz20ty0LVox0lF ICxnfVXzvkFHcUliqi84qZV9vnjKj58nTvMC7s5eQhHYN108eAGs3cnPM7A9HIgbrs7dNp dYjiAePYH7+jPaCEwbd1bf1RBpR4xmg= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf28.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677666961; a=rsa-sha256; cv=none; b=cZNIsUb8P0Ow1eHGqAmHGUN1CQOfeE0eaLzQjwjxmOmlW4eVB5+yY2dgatzQ9D+lJgKwY0 zh7JXpvz0R0mJoAKeL3lGukeEnsExPnr19sDAYvwyXzEAKeWacIeNzKxFGwmbgRVyMlaGG Jcw/4UaaCvcU6N3Es7A/vIm4Ace6oFw= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D6E202F4; Wed, 1 Mar 2023 02:36:43 -0800 (PST) Received: from [10.57.79.100] (unknown [10.57.79.100]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 88C413F881; Wed, 1 Mar 2023 02:35:59 -0800 (PST) Message-ID: Date: Wed, 1 Mar 2023 10:35:58 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [LSF/MM/BPF TOPIC] Flexible orders for anonymous folios Content-Language: en-US To: Matthew Wilcox , Yu Zhao Cc: lsf-pc@lists.linux-foundation.org, Linux-MM , Yang Shi , "Yin, Fengwei" , Hugh Dickins , "Kirill A . Shutemov" References: From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9F470C0003 X-Stat-Signature: pc8ayoqt56f5bybu937beiher3uz9nyt X-Rspam-User: X-HE-Tag: 1677666961-168787 X-HE-Meta: U2FsdGVkX190bHML8a/6KnKIcsUTbEjYoxWm8t6Me4jpKuGAc5+6vusvWTnHaLOQoH4aeeONoca2QE0ywGM+GLFAOoetKYKefo87fm/dMO07j9i3ndwq8G96n5I4Yx4I3k11KxCsNd2tKF5LuYb4Ad/iRyXYfnva3lQR7HH9DtxxcolA6aKE6CkTht2c4zclTIY06wk9Vrt0goQWEDXFk5ZzhTrieE5OHipSQD9pCvhP6JMOwZUDkLLk/jZtUt5r5QFSQxdrmuAkTcDKxHnUW8IDc/etpRwpGgK60Cvd1lwVC8dp8K4TpYjbCie01+Gx43vQsO6Vd19B4DWTeTFXYtmzUaWEVdAopwIderrG/CTHmsYAn8khAiQ9MGzPMApBJRLuOxm53M5MNxoMVzhvXXFfAB3FfiIhMvXKjBP2l3OKxzHeOt3Jk1ea8c+lfDccLzziPBq7JQ72KtyBDChpyv6GgNL7H7SGDgdKqCI5g7M7MmhxgSnDeIxmqdS78fFCU4wyoi9WDvPcwgJVHje5Rw1JXaeKhnDnAFRtGii2yZHD2y6bgS4xcpLnP2Jm4u+83vFJr2yF+zA0sWjVmtcKdk/8sr0quqp+x2svjyuvZUI+qGtaY9/El97fF9TVJxc7o+PK2XGl5nn0vo7SxjQWrMKjYtgZYs88I3coUHdEoVZnDOP3QxsLE6brw360lvYm9grGr86iQdaOJmn37ywfDWW6eXgwrCXTs0+D/SEdVADf/3+yIaro6iE0HYCiHzTObk/3yIBQ0GLfWErvTj/uRvcWdQNcrRhLTsWtIyZr9WEHEajzdOm7P+sR2NwAsNDLHnCA2dWQUwktg/QkL2r3bFC3rhbuMaPDQBjI95rgrUlRvGUmXi3OD2XeXnRbhAa5O3xvu2BU86pNHJlZ1qnqbtNTX3mJktbLSuY6B4OOTWg3w7yFsx+yPJZ/mHN/kTPZZJ2iIET9AS7m2NxECGq BzK2Jwmv 0zcEIAqMjdalQP5FP2chlO1n8APonUFhyKVO3VGy16VgGYpfZFX5N57t26sQLiRT5c8X1DoYjpfdasSeO0TvqhViVYn04gQlx75NGLPRTb39eyYsoAOOtzCKOtB1crgvn/PAX71B1dbLSbvPcYPddqQlwJKtdhgtiOn7nQQzkUtUzVmkMGBzoUvjw2J3xIKLgnNrn/4UWjmLzvPm1jJ63EiwEguFgQiXa9GLC/BAJeIXINJsOQv74PHa+kwfCeAGzyhvnlo6boOYjAAU2XvSkFRZto6OoFmbhsOVy8sThncrik/C4UgudBlExTxNlQLHR/HSGkSLCxWRE/gY= 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 23/02/2023 04:01, Matthew Wilcox wrote: > On Wed, Feb 22, 2023 at 04:55:20PM -0700, Yu Zhao wrote: >> Currently anonymous folios only support two orders: 0 and the PMD >> order. Flexible orders for anonymous folios can resist both internal >> or external fragmentations when the PMD order is too underutilized or >> costly to allocate. Flexible orders can also leverage the TLB >> coalescing feature, .e.g., order 3 for AMD and order 4 for ARM CPUs. >> >> Discussion points: >> 1. The page fault path: determining the best order and the fallback policy. >> 2. The reclaim path: detecting the utilization and the splitting policy. >> 3. The refcount and the mapcount models, e.g., reuse the PMD-mapped >> THP model or not. >> 4. The splitting, and the collapsing if needed. >> 5. Other paths: COW, GUP, madvise(), mprotect(), page migration, etc. > > 6. Swap out an entire folio instead of splitting it before swap. > 7. At some point we're going to want Zi Yan's patches to split a folio > into arbitrary order folios instead of just to order-0. > 8. For file folios, folio->index % folio->nr_pages is 0. Do we want > to maintain that invariant for anon folios? It helps tile the > folios so we don't end up with say, order-0, order-4, order-2 folios > in a sequence. > 9. How do we ensure that two page faults do not overwrite each others > folios, eg PF1 decides to allocate an order-0 folio at index 6 and > PF2 decides to allocate an order-2 folio at index 4? > > Probably some other things left to decide. > >> Now it seems to be a good time to revisit. Yang Shi and I have been >> looking at some details, trying to scope out the work that would be >> required. We don't have anything definitive yet, but we should have >> enough to share by the time of the LSF/MM/BPF. > > Excellent. There are other people also interested in this. eg: > > Ryan Roberts: https://lore.kernel.org/linux-mm/4c991dcb-c5bb-86bb-5a29-05df24429607@arm.com/ Yes, I'm very interested, and would be keen to join the discussion. I have some thoughts in this mail, if you want to have a look: https://lore.kernel.org/linux-mm/a7cd938e-a86f-e3af-f56c-433c92ac69c2@arm.com/ Feel free to CC me on any discussion. > Fengwei Yin: https://lore.kernel.org/linux-mm/20230109072232.2398464-1-fengwei.yin@intel.com/ > > Obviously I'm keenly interested. > https://lore.kernel.org/linux-mm/Y%2FU8bQd15aUO97vS@casper.infradead.org/ > > This is definitely worth its own session in the MM track. > >