Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16484014rwd; Mon, 26 Jun 2023 10:34:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WjMVJwjE6+jsapBHmNsSczxBuZkAOR3bik+KP+J61wldPuUBIWbPZ5OmOp0/gqXWtQWQm X-Received: by 2002:a05:6a00:a86:b0:652:a91c:55a0 with SMTP id b6-20020a056a000a8600b00652a91c55a0mr29918840pfl.25.1687800865708; Mon, 26 Jun 2023 10:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687800865; cv=none; d=google.com; s=arc-20160816; b=FmgFRB/axq5+DSYOyNw0XzQWGJQxBJfOcjAh7mTO30pW07bUs9tbmqSGPKOpSYnEqY vDzzISIgVRwvBlKxrb/CLNC7XWTR5RMAKgRMxT1LQfpQECDInc5cwqyLOesKLSh+bLbW WJl9nE/qh4dN9IMi946H25eeL0tVDChhyYawSFHmd37wZWiby1pAZoaOIXOhxw2u3cE4 z/kh6lEW7VIHFau4EcP5a8jYmfqF4t0JcplAttNBJErDd/3J069e3Mnw6wyc0doGRyB3 IVxB0UnWJ3CLCj12sZiQfyNNF4WqeUkNgExRjNPed/F7LL7r9BY2C21tzaXoWRnb5aDM I4+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9LDnxtcMGKzMwMeO2DGDBjGbhx12txEm8328niFWh5M=; fh=H2MVjBlipHVEN6kEAh1RDhnPLB9jpPNjGExTmo1/EvA=; b=nKA/X7wJ2qAMcdLUxkinRODrg0+l4YBB61gNqZxghnz/dH4Bfp9nd5Zm4K+BHVuoUP Mnj8HmIRxZLpB/egteN6jB8gWkSghhfMoHnHhIyFGa9bCYGPtcVumiCuYfC8JRTIYK8Y avG6yv6EiL75jGHtJoXS0vrUbZnBfLMONPU3xSdF+OEHORxLsLjW3IdiQ09RjLgDcaIW 7Aqh0wZUhuaFQ6+ySSmDevtBsgBBQP0+M8AffjJx29pdRjxWiyGsYXQdHO1aSH/NVaR0 C8jonXZICxNeo81mhiTgYB40Z7znEwgs5naGZp6foQvxJTjKhBQ9m+atYk0st4BJuX2G GGwg== 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 r20-20020a62e414000000b0065caa80ad8csi4144716pfh.398.2023.06.26.10.34.13; Mon, 26 Jun 2023 10:34:25 -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 S231297AbjFZRPo (ORCPT + 99 others); Mon, 26 Jun 2023 13:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231356AbjFZRPC (ORCPT ); Mon, 26 Jun 2023 13:15:02 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C05EB10F5; Mon, 26 Jun 2023 10:14:59 -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 94AD9152B; Mon, 26 Jun 2023 10:15:43 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AB7DB3F663; Mon, 26 Jun 2023 10:14:56 -0700 (PDT) From: Ryan Roberts To: Andrew Morton , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Cc: Ryan Roberts , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-s390@vger.kernel.org Subject: [PATCH v1 06/10] mm: Allow deferred splitting of arbitrary large anon folios Date: Mon, 26 Jun 2023 18:14:26 +0100 Message-Id: <20230626171430.3167004-7-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230626171430.3167004-1-ryan.roberts@arm.com> References: <20230626171430.3167004-1-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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 With 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 --- mm/rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/rmap.c b/mm/rmap.c index ac1d93d43f2b..3d11c5fb6090 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1567,7 +1567,7 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma, * page of the folio is unmapped and at least one page * is still mapped. */ - 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); } -- 2.25.1