Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5743434rwp; Mon, 17 Jul 2023 08:49:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlEs3rm3lBBzxOTRv+c+saaxd7Czyghuh8+TCSmXfsEa6XWSZqL3Dvr/hwwfoz1GUwsidHhQ X-Received: by 2002:a05:6512:10d6:b0:4f9:51ac:41eb with SMTP id k22-20020a05651210d600b004f951ac41ebmr8460885lfg.16.1689608992384; Mon, 17 Jul 2023 08:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689608992; cv=none; d=google.com; s=arc-20160816; b=ZcoeFPlC5114WQIvo1CJAvgLm12iSBV7SGs3vTAvoZb17XqVMVTW13XsjHKvQawYGr LgzUcfvegSbGkJ/Ksu9mGc7O2yTE+5T1Vu8c4cHZX0P2XE+bd0zu5f/xEsQCPwRtk6nn xTOVtb76Q3TdFC8WJAAOKudjcXpN4BJn0OkGkiQWgwZ1EtEmz2Invu0IGIcIuJf7vHm+ e3aPakCwHvBPczeLceRZ6PlaYTqMH4gK5TQoyVeJqvgNog3DK+zHAVSCr6auJcFgSnh2 ttq2nbnYoj8zrDhosS8VfMz2cWb0/Ia6Ozt++BIsJaaGpwXZNVNMsZWFVNwCFUZcixxS ++Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2Q37pZ8IBxOhr5Sa+/a5uMV+7jb/8DQNXvCzdrgVpWA=; fh=rS1QZdCRoNMTDpCw/TVgIbl4vPAz4Mto5gEfqjXd7eg=; b=dZm70S4fQYCOeQSAwcgvMGmgmD+R2jg7HVZEeGP+bjK270cXsSAneTgzaZynQP4NjR 83FfCxnWrG9OPF9YSjsl2BKT0OmzPwuzXNjdMp+M4oDmXcWU2jjNo+uXf+OyfViW2zx5 iOsVtquq4zxmV7fy0liVikNI6xzd9/Mf1wCfjfj1XMqoinmXEuDDE/3L6avoLihxaheW XLUDTEUJbbSm/ePa4h/WA7qblPSIJqvJpPTO7a4m8oeFLb/06DdUmx8nqpmjQ0sVJmBN 6Df6Lw2wWnIHTwYWJ5M/Vt6TXHN7/YfuRi1poZLviF6lBe2FNDtecJwrnnrvlQuihAyN UQuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VLQRzgjz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc18-20020a056402205200b0051a200c2d2bsi14734718edb.395.2023.07.17.08.49.27; Mon, 17 Jul 2023 08:49:52 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VLQRzgjz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbjGQPbj (ORCPT + 99 others); Mon, 17 Jul 2023 11:31:39 -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> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 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.