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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7291AEB64DC for ; Mon, 17 Jul 2023 15:41:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231301AbjGQPlm (ORCPT ); Mon, 17 Jul 2023 11:41:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbjGQPll (ORCPT ); Mon, 17 Jul 2023 11:41:41 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DD011103 for ; Mon, 17 Jul 2023 08:41:39 -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 D19C1C15; Mon, 17 Jul 2023 08:42:22 -0700 (PDT) Received: from [10.57.76.30] (unknown [10.57.76.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E8A033F738; Mon, 17 Jul 2023 08:41:36 -0700 (PDT) Message-ID: <283e4122-c23f-35a1-4782-fddde32f4ad4@arm.com> Date: Mon, 17 Jul 2023 16:41:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v1 1/3] mm: Allow deferred splitting of arbitrary large anon folios To: Matthew Wilcox Cc: Andrew Morton , Yin Fengwei , David Hildenbrand , Yu Zhao , Yang Shi , "Huang, Ying" , Zi Yan , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20230717143110.260162-1-ryan.roberts@arm.com> <20230717143110.260162-2-ryan.roberts@arm.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/07/2023 16:30, Matthew Wilcox wrote: > On Mon, Jul 17, 2023 at 03:31:08PM +0100, Ryan Roberts wrote: >> In preparation for the introduction of large folios for anonymous >> memory, we would like to be able to split them when they have unmapped >> subpages, in order to free those unused pages under memory pressure. So >> remove the artificial requirement that the large folio needed to be at >> least PMD-sized. >> >> Signed-off-by: Ryan Roberts >> Reviewed-by: Yu Zhao >> Reviewed-by: Yin Fengwei > > Reviewed-by: Matthew Wilcox (Oracle) Thanks! > >> */ >> - if (folio_test_pmd_mappable(folio) && folio_test_anon(folio)) >> + if (folio_test_large(folio) && folio_test_anon(folio)) >> if (!compound || nr < nr_pmdmapped) >> deferred_split_folio(folio); > > I wonder if it's worth introducing a folio_test_deferred_split() (better > naming appreciated ...) to allow us to allocate order-1 folios and not > do horrible things. Maybe it's not worth supporting order-1 folios; > we're always better off going to order-2 immediately. Just thinking. There is more than just _deferred_list in the 3rd page; you also have _flags_2a and _head_2a. I guess you know much better than me what they store. But I'm guessing its harder than jsut not splitting an order-1 page? With the direction of large anon folios (_not_ retrying with every order down to 0), I'm not sure what the use case would be for order-1 anyway?