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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C6E4C4167B for ; Mon, 27 Nov 2023 14:13:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A9096B0250; Mon, 27 Nov 2023 09:13:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 958636B0282; Mon, 27 Nov 2023 09:13:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86FB46B028C; Mon, 27 Nov 2023 09:13:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 77B606B0250 for ; Mon, 27 Nov 2023 09:13:40 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4C5C8402C2 for ; Mon, 27 Nov 2023 14:13:40 +0000 (UTC) X-FDA: 81503927400.30.217D16C Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf24.hostedemail.com (Postfix) with ESMTP id 81232180141 for ; Mon, 27 Nov 2023 14:11:58 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701094318; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bbl/FMv26uuobCgz3Kn9o9CbK93ew6elue6vqBgEEWY=; b=pQP0okAm41AvR6vrYJlQJzNVwJNFYQBECL7LUybjoQrJpO+qh1bkFuPM2dRVStBJaReqgS cuYE/4k/0x3CEeUhnOWBAkFZGUarr+hzAVWxHQiaiwfduL21ZeIfBDHrBXT1m08YS9wIin 2C149Iuzg6GErIBDoDe1HaCA1F2iZsw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701094318; a=rsa-sha256; cv=none; b=aYODwZ2woF+KyinPnsCtaJDRV5IOxontSXEZ1EMKKMSLw2WNV5CnMuZhvppb/0mm93MN9T 9dZ0NAPUykLDfAHwZDmiLMjHmWjUM80InfMvdKGO/opxLOfjQjiO1M4wEf2sopanpEf6ch QUcWC6018jzbM//2tXGvH0Br51wc860= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com 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-Rspamd-Queue-Id: 81232180141 X-Rspam-User: X-Stat-Signature: p81je55btk8umjbj6a5fzefxmcwzgqdy X-Rspamd-Server: rspam03 X-HE-Tag: 1701094318-99001 X-HE-Meta: U2FsdGVkX1+fTBhP/+2S5XE3FzoNQHGMFkg8b0RfFezArrvFlD9o6JbYjQmRGo/Koe34Txx8grgWCzD/olt5AHuI6HwOEAaIYI+2qfBmtYxyr7D2a3h1MGUPBvtr+zJfbo3cIpw4YRC6EpMtEhGVfjfQnbTfl5Sb0IlxQvpl8K2O7EhaQc0x2yTDPOTVRNlV5IXoW5Tis8G2lj+Kj17xY60Em2TMGJXpo+lnC3OGWEUD4Cq/RC1RvPUpEgxPUBbmXvCio2VAQwhrT94gPlbZoLwZvXpq7j6nJ8pKUKM5C4OUB0FHG8OZEA3o60fjEUTBpbE2yTO0vplFlHbQpYWZck6wk07mwbLNlGihMgqAhGFH0BGb+s/CwkA4uN95v8HVXkAlerJAAaSyoflLumf0gPwWMaGklEmbY+E1T3e4aWtUPt3turpC0GGAi/YdvtsvFItao6pyLKlG2EnlMnTX6sZi+js29FFz4uKaJ6EymxCMzeXPoAdH9YB8uryeJkoZBaZN0427AH9KRphVxkSQFDRkyZljzK/G2HQXSd9dJQh6BO26pZ5OJQ8zLlAvRj12ibBOPwSPT/BsISHCmEaVBDeS2fGZ0tOTGy9eJylGW88JKNJbjD82ofLyY/+4L0KOVlGK3QhgDt1WAcRO49srEI81ISbMs8QBbYIqueRWhz2meV1oWe8F/Bz8sR0BgRiwzK9HtwyP8PWNQGq8zs5XG4fG4No9Ot54fJ0IfFYyCgrjplvjlR87X2n4EFWaOuavj3gVZn53R6Z7d7csjG7e3PTwJBAQO1EvnIP1C+0xE3K/kfajxIWTWMJqJQyA5e1XqxvJBoY5QSxwxygJT/ToAcIjTf7PA5GOV1/y/QspQ/pRwLnEtwX8HEVQ68LDrUQmo6NqENDjzdbnrMCUNJZJLwUohPRxS9R1jux0jfnBNx5cgryRc65hQeSjshQG4IIlDKmLx1pthw1rqowwLLW QdIwRzbI W6eYPCQ7WgyvRU2Cr6YaehGZR3lwfp93styrG8yqwDvyuuxdpcgcQdiClvvSSDk3yhYRAAA2O2OYrS6n3G3MSSOeyEI9I+b9fb7XhEAG505iMJjVi/TBFxAt06xJgmTI8/hX6UNIgT4PQR0qSOQKpd/UMWM+ChhD6hHQnz6I7nyeqskt7T8VTJE8GiI8J/IgvLXu1o99tgxgxFa5+yRIkGWNm1QI2FER1Lm3FIw/nyTcBjT6dCtKJqUjLFk8JdcO8CBLG+cGKDzNIPW4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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.