Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30142014rwd; Thu, 6 Jul 2023 01:15:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlGQV8zEE2595PVP/XONNrSUaXAUyT3aecBZk5bS0D5QnwG8wN5I5+AMTnV+cNkasH+xdtxm X-Received: by 2002:a05:6a00:2444:b0:67e:ca79:36f0 with SMTP id d4-20020a056a00244400b0067eca7936f0mr1401958pfj.0.1688631338915; Thu, 06 Jul 2023 01:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688631338; cv=none; d=google.com; s=arc-20160816; b=zuamNnhI13DfgiivuvqIu66BUIuEfKbzGX969I2+2sucLaYQW2W9jQYUlrhnJLQPLl Xr2ogpQHDfbTJYOTxzls+d8eQmv/hVnN8D8XJJS2rzPdteDeb49LoeARiTMjmVFII0e5 AMFDhDLdM7XM0F3fDJ5qxOY30ssIBQxsXAI7JLnqeUtdLKB+2RUd7reIhBEOf/WmbY/b JUrhUEFoMNu478aXNXlIIshWJQlRH9x2C+1qMDznGgzIG03xP3hUcEfMHqN6fPwcLOpC M335yuPk0pvMy5XH3UwrkL6Nu4sHXqrkqO4ZeqBttCO4hNq1ykBoQ8fyGDRiwvIYov2Z kRJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=j+SbKMH6OI6PELpyAxJWocTdrTEeSjPnyCuyOz3G0lE=; fh=J+T/oUefQnr5MmubR5NgDwyx3vw8QlfaWagHBZi7y0o=; b=Pyg43wJQp7mphIvkQg9lNuRzTw5jgqixrKR0rK0NetPf8Rv3FPCnhLpUkEOwhomamW +UgBzY1XHlZYfUKoIRP8RAPI5KxRHchLgEU0LmfyVpH/m6zEmAgkoKi1kQjPZgrrMCoC 5MJQAGPdmxcnfYDWIw4RBvDd54yptu1ZFw/dzdYro2onFXgnK6HAjdn+YWFPnNbueev0 9pFph8Gk5vOz6kJDp1oYrZSmsT6VXGBw1wQH8n/G58Foen/Lt5Zzm7aa2xpTTUfCWXVX /aIZs+8ijXZgExNoANbE3KYIpeCHaYN51RI+vRuJmrtxKPXm0oDjMk/He0ePUVA0secN VU2Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a056a00080b00b006821425440bsi178830pfk.279.2023.07.06.01.15.24; Thu, 06 Jul 2023 01:15:38 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233608AbjGFICi (ORCPT + 99 others); Thu, 6 Jul 2023 04:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233161AbjGFICf (ORCPT ); Thu, 6 Jul 2023 04:02:35 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 97E431726 for ; Thu, 6 Jul 2023 01:02:34 -0700 (PDT) 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 34F832F4; Thu, 6 Jul 2023 01:03:16 -0700 (PDT) Received: from [10.57.76.116] (unknown [10.57.76.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F5A53F73F; Thu, 6 Jul 2023 01:02:32 -0700 (PDT) Message-ID: <4d4c45a2-0037-71de-b182-f516fee07e67@arm.com> Date: Thu, 6 Jul 2023 09:02:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 0/5] variable-order, large folios for anonymous memory To: David Hildenbrand , Andrew Morton , Matthew Wilcox , "Kirill A. Shutemov" , Yin Fengwei , Yu Zhao , Catalin Marinas , Will Deacon , Anshuman Khandual , Yang Shi Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20230703135330.1865927-1-ryan.roberts@arm.com> <78159ed0-a233-9afb-712f-2df1a4858b22@redhat.com> From: Ryan Roberts In-Reply-To: <78159ed0-a233-9afb-712f-2df1a4858b22@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 05/07/2023 20:38, David Hildenbrand wrote: > On 03.07.23 15:53, Ryan Roberts wrote: >> Hi All, >> >> This is v2 of a series to implement variable order, large folios for anonymous >> memory. The objective of this is to improve performance by allocating larger >> chunks of memory during anonymous page faults. See [1] for background. >> [...] >> Thanks, >> Ryan > > Hi Ryan, > > is page migration already working as expected (what about page compaction?), and > do we handle migration -ENOMEM when allocating a target page: do we split an > fallback to 4k page migration? > Hi David, All, This series aims to be the bare minimum to demonstrate allocation of large anon folios. As such, there is a laundry list of things that need to be done for this feature to play nicely with other features. My preferred route is to merge this with it's Kconfig defaulted to disabled, and its Kconfig description clearly shouting that it's EXPERIMENTAL with an explanation of why (similar to READ_ONLY_THP_FOR_FS). That said, I've put together a table of the items that I'm aware of that need attention. It would be great if people can review and add any missing items. Then we can hopefully parallelize the implementation work. David, I don't think the items you raised are covered - would you mind providing a bit more detail so I can add them to the list? (or just add them to the list yourself, if you prefer). --- - item: mlock description: >- Large, pte-mapped folios are ignored when mlock is requested. Code comment for mlock_vma_folio() says "...filter out pte mappings of THPs, which cannot be consistently counted: a pte mapping of the THP head cannot be distinguished by the page alone." location: - mlock_pte_range() - mlock_vma_folio() assignee: Yin, Fengwei - item: numa balancing description: >- Large, pte-mapped folios are ignored by numa-balancing code. Commit comment (e81c480): "We're going to have THP mapped with PTEs. It will confuse numabalancing. Let's skip them for now." location: - do_numa_page() assignee: - item: madvise description: >- MADV_COLD, MADV_PAGEOUT, MADV_FREE: For large folios, code assumes exclusive only if mapcount==1, else skips remainder of operation. For large, pte-mapped folios, exclusive folios can have mapcount upto nr_pages and still be exclusive. Even better; don't split the folio if it fits entirely within the range? Discussion at https://lore.kernel.org/linux-mm/6cec6f68-248e-63b4-5615-9e0f3f819a0a@redhat.com/ talks about changing folio mapcounting - may help determine if exclusive without pgtable scan? location: - madvise_cold_or_pageout_pte_range() - madvise_free_pte_range() assignee: - item: shrink_folio_list description: >- Raised by Yu Zhao; I can't see the problem in the code - need clarification location: - shrink_folio_list() assignee: - item: compaction description: >- Raised at LSFMM: Compaction skips non-order-0 pages. Already problem for page-cache pages today. Is my understand correct? location: - assignee: --- Thanks, Ryan