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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C746DC4167B for ; Mon, 13 Nov 2023 10:20:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Wh907u/har248GHQpc8vG6oJhY5qae1oiqqz5K5J+vQ=; b=TtSHcStcXGsQmi ZpI0+BkM1Pv/lED3aHuoIWyYENJP5kT3f0FI7gvbPGC91Qt5WNSjgUxLpFLd+S6BJl6vzsq6VNprx G7oA93VpFCFqmud0OCnQUYbCsC6W+j/bS9SLaUcyLokWWgJTmFgpMhP/IBSgno0YwktoTkOwUTB6s AB8xzFjp7ZHs/h3YSqjVKH8AUkPFV0L5X3NImOrOsmM5jNHR91md0QzQ+VUqD2myU6oLRnKwHE8u5 KjWlkczFBTrwcP5AWxYsnBuHWsDPRpUtJChOTnvDK5vcpPl78zFAEN92Tg+/Y0CU1gY1uT0KIA3e3 MiJqWVWHFaS34bC4S7TQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2U2x-00Ddg7-2f; Mon, 13 Nov 2023 10:19:59 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2U2v-00Dden-29 for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2023 10:19:59 +0000 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 C4C9414BF; Mon, 13 Nov 2023 02:20:37 -0800 (PST) Received: from [10.57.73.13] (unknown [10.57.73.13]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CE5403F6C4; Mon, 13 Nov 2023 02:19:49 -0800 (PST) Message-ID: Date: Mon, 13 Nov 2023 10:19:48 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 0/9] variable-order, large folios for anonymous memory Content-Language: en-GB To: Matthew Wilcox , John Hubbard Cc: Andrew Morton , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , David Rientjes , Vlastimil Babka , Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20230929114421.3761121-1-ryan.roberts@arm.com> From: Ryan Roberts In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231113_021957_816398_DB0C4CD5 X-CRM114-Status: GOOD ( 18.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 13/11/2023 05:18, Matthew Wilcox wrote: > On Sun, Nov 12, 2023 at 10:57:47PM -0500, John Hubbard wrote: >> I've done some initial performance testing of this patchset on an arm64 >> SBSA server. When these patches are combined with the arm64 arch contpte >> patches in Ryan's git tree (he has conveniently combined everything >> here: [1]), we are seeing a remarkable, consistent speedup of 10.5x on >> some memory-intensive workloads. Many test runs, conducted independently >> by different engineers and on different machines, have convinced me and >> my colleagues that this is an accurate result. >> >> In order to achieve that result, we used the git tree in [1] with >> following settings: >> >> echo always >/sys/kernel/mm/transparent_hugepage/enabled >> echo recommend >/sys/kernel/mm/transparent_hugepage/anon_orders >> >> This was on a aarch64 machine configure to use a 64KB base page size. >> That configuration means that the PMD size is 512MB, which is of course >> too large for practical use as a pure PMD-THP. However, with with these >> small-size (less than PMD-sized) THPs, we get the improvements in TLB >> coverage, while still getting pages that are small enough to be >> effectively usable. > > That is quite remarkable! Yes, agreed - thanks for sharing these results! A very nice Monday morning boost! > > My hope is to abolish the 64kB page size configuration. ie instead of > using the mixture of page sizes that you currently are -- 64k and > 1M (right? Order-0, and order-4) Not quite; the contpte-size for a 64K page size is 2M/order-5. (and yes, it is 64K/order-4 for a 4K page size, and 2M/order-7 for a 16K page size. I agree that intuitively you would expect the order to remain constant, but it doesn't). The "recommend" setting above will actually enable order-3 as well even though there is no HW benefit to this. So the full set of available memory sizes here is: 64K/order-0, 512K/order-3, 2M/order-5, 512M/order-13 > , that 4k, 64k and 2MB (order-0, > order-4 and order-9) will provide better performance. > > Have you run any experiements with a 4kB page size? Agree that would be interesting with 64K small-sized THP enabled. And I'd love to get to a world were we universally deal in variable sized chunks of memory, aligned on 4K boundaries. In my experience though, there are still some performance benefits to 64K base page vs 4K+contpte; the page tables are more cache efficient for the former case - 64K of memory is described by 8 bytes in the former vs 8x16=128 bytes in the latter. In practice the HW will still only read 8 bytes in the latter but that's taking up a full cache line vs the former where a single cache line stores 8x 64K entries. Thanks, Ryan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel