Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3021625rwo; Mon, 24 Jul 2023 05:14:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlEA38ekckEQvlmumMcWgFLP5HSpU+zWoiYQRxrjtmScVbEikD3LMMAcKOQXRZxKr9NaWB9K X-Received: by 2002:a05:6a00:3305:b0:65e:1d92:c0cc with SMTP id cq5-20020a056a00330500b0065e1d92c0ccmr9286780pfb.10.1690200879525; Mon, 24 Jul 2023 05:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690200879; cv=none; d=google.com; s=arc-20160816; b=kP+VN9f2q4VWK5ul0qs8dm/7sqZ5hJC2+8hwTmeDKhBbtmkUD3RtzWqCELb/8hCGIU +rSLRTdVdZKcaFofQkPNp7oUshqc6rMMFOxALdVyTWd9cVyZ+CSz8ex+t/Uj1T2Ccpw9 tkQYb5tRn1DkuAux9nj5Uro/u6829Kj5rkd5LRAn/TKrs+qFwB9WGQ56EMXUJ477aMIq xEowr4e+SR3uQBRc8XPTmNGydrtxpYQluJF6e3JNL/8uHqivPwtGmC1/tb8VWY8ZN558 HAdFX0weiHtfbvFdJbiDkRkSAOhPTepsSlS2DNH226esUuZh1QZ6uEiHubeGh1RfatGi Sp4g== 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:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=YcSCb4dlzcK3dWaMHWJCk4mRNmhV5WOUBzp9rUOy/6w=; fh=Wz6cdTAZJo981xmbEgKI3OjMFkDr5MtaB6ZNO8i5x3Y=; b=bfAgc2yPC2M/oQC1HNuVNt2tVzKLbU2tqZqDgG7k5mkjhMe6TzQh3FCBfto/rTU4PV v15Pnv0i99MQyZ1qgPkyUTsr+6aRWBA5aP0cY+YaVa38I7t6YPnQ8p7MDUJvIwTjiKvc HiaGDQ23da1thMY/BxAiCQ39n3ZNTmGn7hTkqP75KINruyEFnJQECph0ADfvCjyiXqQS hhXGBjtpLVYUzX+JjKz+TY2Ys0IpX/cFEG1YsUWE9dB3YnfnvV8LRAP1YSJOt8bWgYsV oydx1P3ElV71Y8rnkDP74oaCwq3s8LyL3pIJLaCeXi9JeUC5aUuqYY4nlQFrAbfuflUh ifHg== 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 p9-20020a056a000b4900b00678a41b5a59si9444128pfo.349.2023.07.24.05.14.26; Mon, 24 Jul 2023 05:14:39 -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 S229645AbjGXL7j (ORCPT + 99 others); Mon, 24 Jul 2023 07:59:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbjGXL7i (ORCPT ); Mon, 24 Jul 2023 07:59:38 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D6D92FA for ; Mon, 24 Jul 2023 04:59:37 -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 B78D8FEC; Mon, 24 Jul 2023 05:00:20 -0700 (PDT) Received: from [10.57.76.172] (unknown [10.57.76.172]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 39E4B3F5A1; Mon, 24 Jul 2023 04:59:35 -0700 (PDT) Message-ID: <83bb1b99-81d3-0f32-4bf2-032cb512a1a1@arm.com> Date: Mon, 24 Jul 2023 12:59:33 +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 v3 0/4] variable-order, large folios for anonymous memory To: Andrew Morton , Matthew Wilcox , "Kirill A. Shutemov" , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Will Deacon , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20230714160407.4142030-1-ryan.roberts@arm.com> From: Ryan Roberts In-Reply-To: <20230714160407.4142030-1-ryan.roberts@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 On 14/07/2023 17:04, Ryan Roberts wrote: > Hi All, > > This is v3 of a series to implement variable order, large folios for anonymous > memory. (currently called "FLEXIBLE_THP") The objective of this is to improve > performance by allocating larger chunks of memory during anonymous page faults. > See [1] and [2] for background. A question for anyone that can help; I'm preparing v4 and as part of that am running the mm selftests, now that I've fixed them up to run reliably for arm64. This is showing 2 regressions vs the v6.5-rc3 baseline: 1) khugepaged test fails here: # Run test: collapse_max_ptes_none (khugepaged:anon) # Maybe collapse with max_ptes_none exceeded.... Fail # Unexpected huge page 2) split_huge_page_test fails with: # Still AnonHugePages not split I *think* (but haven't yet verified) that (1) is due to khugepaged ignoring non-order-0 folios when looking for candidates to collapse. Now that we have large anon folios, the memory allocated by the test is in large folios and therefore does not get collapsed. We understand this issue, and I believe DavidH's new scheme for determining exclusive vs shared should give us the tools to solve this. But (2) is weird. If I run this test on its own immediately after booting, it passes. If I then run the khugepaged test, then re-run this test, it fails. The test is allocating 4 hugepages, then requesting they are split using the debugfs interface. Then the test looks at /proc/self/smaps to check that AnonHugePages is back to 0. In both the passing and failing cases, the kernel thinks that it has successfully split the pages; the debug logs in split_huge_pages_pid() confirm this. In the failing case, I wonder if somehow khugepaged could be immediately re-collapsing the pages before user sapce can observe the split? Perhaps the failed khugepaged test has left khugepaged in an "awake" state and it immediately pounces? Thanks, Ryan