Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3086338rdh; Mon, 27 Nov 2023 06:18:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8GRQklf+7a9W3hvgm0vJCE7Dg6+Zc2Raf5O9vY205xObr/ozB5N9/lLP0D1lVSNCuM1wU X-Received: by 2002:a9d:748b:0:b0:6b9:dc90:8a85 with SMTP id t11-20020a9d748b000000b006b9dc908a85mr12937003otk.24.1701094687596; Mon, 27 Nov 2023 06:18:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701094687; cv=none; d=google.com; s=arc-20160816; b=tCDJ1YJwGnnDkSooCNvBzo90MTcKnhviFmJaTjggDuEyhdlzVrKwJ2vZdDhhaaA9sY P+yvr8sfetCdPUrajopAn6aJ991CbEdQqJtYpbqsQDmfP0YRW+QHocGo4xjEDiDpeGzQ TG8XszU+oInEL0eOQ5TUABlOPMUNpUMNwyKTcIzn0S9iKcbmX3EHvuUMd0plRPvcE6Gt RjeozgZR4CrHyPaWvedAlwsjx2kz2n1e3GwgfJTQDzJ40xd/IBWcMxEWunHt8tXgSrOX sIKee5DMvgEvpCiLh8dobWCyaCfdd5z+Zc1r4qJGLXUPFWfoPW8/CmXbCzznfMaJisN1 wcew== 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:content-language:subject:user-agent:mime-version :date:message-id; bh=Bbl/FMv26uuobCgz3Kn9o9CbK93ew6elue6vqBgEEWY=; fh=54AJWpiqQ3cdbHPA70Y9Pk8Om9mG1/HMX+mu17RN1dY=; b=bf44CeOGnNlGg9tYtjFz5zcLnQxnssmJh6maatDMK+vrUmSFFNoKv6UqAsvVB+Jrzf SLzhtuJJttIO4gR99Q1Wyc8z5AjjJobnIXQ9N6vcF9Oz8rbR3GkRNlwX83zY+/oB0tiE CMcvAdVmrP1LK88X5cat/cR5+DMonEvcDs3hoHUjicn4pIRxi9Fqe8ervnfEY/p8DKbe Rp4oul3d4d37p0QeC0V5nQdg8lB71Nl+qlRqCqhSrS7kK2n4yuAiepS6++vi4/BDpbnF Hk2NlIYQigSMPd7XvU9UzQkUF3p7vEb9KMQ6AYilk9PRHJzxT9kxX+kIorbaJ1/hsY8J FQ+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id q40-20020a056830442800b006d47c93bf0csi4022480otv.146.2023.11.27.06.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 06:18:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7F6AE809D3F1; Mon, 27 Nov 2023 06:18:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233567AbjK0ORy (ORCPT + 99 others); Mon, 27 Nov 2023 09:17:54 -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 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 27 Nov 2023 06:18:06 -0800 (PST) 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.