Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp695029rwo; Wed, 2 Aug 2023 02:40:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlG4c25F+tE7lrx70fG+F6f5mgtg31SH+KVXs/756YZecImqG8+Ya+Aw2H/AAYeyMI3Jb85k X-Received: by 2002:a05:6a20:3953:b0:133:38cb:2b93 with SMTP id r19-20020a056a20395300b0013338cb2b93mr18871664pzg.9.1690969246200; Wed, 02 Aug 2023 02:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690969246; cv=none; d=google.com; s=arc-20160816; b=QfSKGx8kL1o6Psj+wjvbMDzOMdHiVgCtCbzqIE96d7xjiNd8GTGOWNRaSv3Cxj6zRe lNRJCoA/9ZPTCIAmt7wRmUpTfgM8jP49KXjmulepeqN9apv96xKmv4tpLYPI5fH2Nj9P XaUsYStl8YhARW9lc6eqNknVNYKo4nOZM3fZFp+Ul3K0L8+TVgUBvsvc2Hb+lJGgYPFC fOrNNC29r9mEwNqISDCK355EnqNSK21C2opmIuFjbgbvNLeQpG5R9YgxIZdzpiKwMWLa CSiiehO/CG1B8ZHnjulXkqhOIxcnui2R1m+zbd2EdfrJwuj01GgEsPIzIpxA5qBBs2ke JYdg== 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:references :cc:to:from:subject:user-agent:mime-version:date:message-id; bh=5AbCZYso0vzZwoGM7igYOxcRVcoenBXyCDN8X7EIGUA=; fh=+T2SqsdYtRjqzUW2t6hmQAYOR+k+bhF/5x3xITsCxS8=; b=TPuQpbjbsj5RwliHLD7Wk/MJOpPYWNNNJo5IHRb+4OpVswGRIaT9nyWViw1T3FIlGk zkzXiC/Cc78g1WD43KFbvMyasnAMbw4+9Za7O5+Lkqlby2oJP3F72aev9n9W4T2ejQEs chWRW/L3x6QG6mNZCLzWrytBK9aI0e9oKWJvX3kRr0rFOIkUoOqzco/0dQXOcTlIdw1Y UxR7wxw8NTwwSRSuARcza6BeQZ/LsdNyIebCMdql+e2DT/IaOmMxqaurIv2VQ8LBGKb2 Tfv1TE4zcV+GpOkTHPPU7/nPKK76nuV2splDJvTK5IAimcPw/w48Co8TiHT7jZEa7MFb BMvg== 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 fh6-20020a056a00390600b006828c76a9f1si7797199pfb.74.2023.08.02.02.40.06; Wed, 02 Aug 2023 02:40:46 -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 S231990AbjHBJFE (ORCPT + 99 others); Wed, 2 Aug 2023 05:05:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjHBJFC (ORCPT ); Wed, 2 Aug 2023 05:05:02 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F13742724 for ; Wed, 2 Aug 2023 02:05:00 -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 C4271113E; Wed, 2 Aug 2023 02:05:43 -0700 (PDT) Received: from [10.57.77.90] (unknown [10.57.77.90]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B1483F5A1; Wed, 2 Aug 2023 02:04:58 -0700 (PDT) Message-ID: <951a8d96-ecdf-7ca4-ec7a-e1c5eba8bce3@arm.com> Date: Wed, 2 Aug 2023 10:04:56 +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 v4 2/5] mm: LARGE_ANON_FOLIO for improved performance From: Ryan Roberts To: Yu Zhao Cc: Andrew Morton , Matthew Wilcox , Yin Fengwei , David Hildenbrand , Catalin Marinas , Will Deacon , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20230726095146.2826796-1-ryan.roberts@arm.com> <20230726095146.2826796-3-ryan.roberts@arm.com> <8c0710e0-a75a-b315-dae1-dd93092e4bd6@arm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 02/08/2023 09:02, Ryan Roberts wrote: ... >>> >>> I've captured run time and peak memory usage, and taken the mean. The stdev for >>> the peak memory usage is big-ish, but I'm confident this still captures the >>> central tendancy well: >>> >>> | MAX_ORDER_UNHINTED | real-time | kern-time | user-time | peak memory | >>> |:-------------------|------------:|------------:|------------:|:------------| >>> | 4k | 0.0% | 0.0% | 0.0% | 0.0% | >>> | 16k | -3.6% | -26.5% | -0.5% | -0.1% | >>> | 32k | -4.8% | -37.4% | -0.6% | -0.1% | >>> | 64k | -5.7% | -42.0% | -0.6% | -1.1% | >>> | 128k | -5.6% | -42.1% | -0.7% | 1.4% | >>> | 256k | -4.9% | -41.9% | -0.4% | 1.9% | >>> >>> 64K looks like the clear sweet spot to me. I'm sorry about this; I've concluded that these tests are flawed. While I'm correctly setting the MAX_ORDER_UNHINTED value in each case, this is run against a 4K base page kernel, which means that it's arch_wants_pte_order() return value is order-4. So for MAX_ORDER_UNHINTED = {64k, 128k, 256k}, the actual order used is order-4 (=64K): order = max(arch_wants_pte_order(), PAGE_ALLOC_COSTLY_ORDER); if (!hugepage_vma_check(vma, vma->vm_flags, false, true, true)) order = min(order, ANON_FOLIO_MAX_ORDER_UNHINTED); So while I think we can conclude that the performance improves from 4k -> 64k, and the peak memory is about the same, we can't conclude that 64k is definely where performance gains peak or that peak memory increases after this. The error bars on the memory consumption are fairly big. I'll rework the tests so that I'm actually measuring what I was intending to measure and repost in due course.