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 DCDEEC0015E for ; Mon, 17 Jul 2023 15:31:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229696AbjGQPbk (ORCPT ); Mon, 17 Jul 2023 11:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbjGQPbi (ORCPT ); Mon, 17 Jul 2023 11:31:38 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CAB91996 for ; Mon, 17 Jul 2023 08:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=2Q37pZ8IBxOhr5Sa+/a5uMV+7jb/8DQNXvCzdrgVpWA=; b=VLQRzgjzCmvWkMyIW1Upa23Zfq h6SWe9w7NlxUIwdx3jEJZc8Bw5inu+veI8+uHp1p1SXFSO/Rr4NdsiCc9AkXxtuUmvrSDxDCuzavA WH6B06Etl2cMkr4FzMAeAbm7IdZRgoacU5O+T6RduXh3luJD6ZclTPkqBuoIaCu1jgJtQWkMpvUl4 eZ8nd+t04KuSmBBZ7hEz6IutF9RObXicIno4Y3W7iJt0frXVavCgvHov/KXBhbYBiquvpPgGrNiXg why7uNlCWm0wylKnqXpIjwtdoamvMb67lFeaEymx8HLdAIicoBvfpvfT9HxWowAoVuXLE6iOeBQ13 jNFBwleg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qLQAi-0042X2-Gl; Mon, 17 Jul 2023 15:30:00 +0000 Date: Mon, 17 Jul 2023 16:30:00 +0100 From: Matthew Wilcox To: Ryan Roberts Cc: Andrew Morton , Yin Fengwei , David Hildenbrand , Yu Zhao , Yang Shi , "Huang, Ying" , Zi Yan , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v1 1/3] mm: Allow deferred splitting of arbitrary large anon folios Message-ID: References: <20230717143110.260162-1-ryan.roberts@arm.com> <20230717143110.260162-2-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230717143110.260162-2-ryan.roberts@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) > */ > - 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.