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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C86FC4167B for ; Mon, 27 Nov 2023 14:18:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233669AbjK0OR4 (ORCPT ); Mon, 27 Nov 2023 09:17:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233568AbjK0ORa (ORCPT ); Mon, 27 Nov 2023 09:17:30 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 94D272112 for ; Mon, 27 Nov 2023 06:11:57 -0800 (PST) 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 D0B182F4; Mon, 27 Nov 2023 06:12:44 -0800 (PST) Received: from [10.57.73.191] (unknown [10.57.73.191]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2D4BD3F6C4; Mon, 27 Nov 2023 06:11:54 -0800 (PST) Message-ID: Date: Mon, 27 Nov 2023 14:11:52 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RESEND PATCH v7 09/10] selftests/mm/cow: Generalize do_run_with_thp() helper Content-Language: en-GB To: David Hildenbrand , Andrew Morton , Matthew Wilcox , Yin Fengwei , Yu Zhao , Catalin Marinas , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , John Hubbard , David Rientjes , Vlastimil Babka , Hugh Dickins , Kefeng Wang Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20231122162950.3854897-1-ryan.roberts@arm.com> <20231122162950.3854897-10-ryan.roberts@arm.com> <15c288aa-feab-4d3a-af33-b87481eaffe3@arm.com> <1ebb9a53-63ee-430c-ba65-8e48eff6d25c@redhat.com> From: Ryan Roberts In-Reply-To: <1ebb9a53-63ee-430c-ba65-8e48eff6d25c@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/11/2023 13:59, David Hildenbrand wrote: >>> >>>> +    pmdsize = read_pmd_pagesize(); >>>> +    if (pmdsize) >>>> +        ksft_print_msg("[INFO] detected PMD-mapped THP size: %zu KiB\n", >>> >>> Maybe simply: "detected PMD size". Zes, we read it via the THP interface, but >>> that shouldn't matter much. >> >> Err, just want to clarify what you are suggesting. With the current patch you >> will see something like: > > Not with this patch, but with the other ones, yes :) Yep, we are on the same page (folio)... > >> >> [INFO] detected PMD-mapped THP size: 2048 KiB >> [INFO] detected small-sized THP size: 64 KiB >> [INFO] detected small-sized THP size: 128 KiB >> ... >> [INFO] detected small-sized THP size: 1024 KiB >> >> >> Are you suggesting something like this: >> >> [INFO] detected PMD size: 2048 KiB >> [INFO] detected THP size: 64 KiB >> [INFO] detected THP size: 128 KiB >> ... >> [INFO] detected THP size: 2048 KiB >> > > Yes. If you'd detect that 2M is actually disabled, you could still log the PMD > size only. Note that in the final patch, where I test the other THP sizes, I'm not detecting which sizes the sysadmin has enabled, I'm detecting the set of sizes that can be enabled, then explicitly enabling the size (exclusively) when I test it. So there is no chance of reading PMD size but not having 2M THP. Minor point though. > > So for this patch only as a preparation > > [INFO] detected PMD size: 2048 KiB > [INFO] detected THP size: 2048 KiB > > Just a thought. Yep this is exactly how I've just reworked it.