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 7F1A7D13580 for ; Sun, 27 Oct 2024 20:36:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EEB276B0093; Sun, 27 Oct 2024 16:36:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E730B6B0096; Sun, 27 Oct 2024 16:36:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEB9C6B0098; Sun, 27 Oct 2024 16:36:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id A7A7E6B0093 for ; Sun, 27 Oct 2024 16:36:49 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 45056A04DC for ; Sun, 27 Oct 2024 20:36:09 +0000 (UTC) X-FDA: 82720539426.20.7C2BC98 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by imf25.hostedemail.com (Postfix) with ESMTP id 2DB57A001B for ; Sun, 27 Oct 2024 20:36:30 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b=KIbiAX9f; spf=pass (imf25.hostedemail.com: domain of mcanal@igalia.com designates 178.60.130.6 as permitted sender) smtp.mailfrom=mcanal@igalia.com; dmarc=pass (policy=none) header.from=igalia.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730061328; a=rsa-sha256; cv=none; b=TIrzK3ehVslpud15n6m2Ep3ks0H+iqepI7sUgiKfRQgzIWSz6qXLtMkkNAEk/sOit8zVqm xzkfS4cNxmnWc1Rj2b2Hi/esSBGMRz0DqjWS20X/DvErO/swo8POG7MGhtdWnYKxLiFAwq OMEEv81puo47MlTy10rG5Qp1HXvxBt0= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b=KIbiAX9f; spf=pass (imf25.hostedemail.com: domain of mcanal@igalia.com designates 178.60.130.6 as permitted sender) smtp.mailfrom=mcanal@igalia.com; dmarc=pass (policy=none) header.from=igalia.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730061328; 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:dkim-signature; bh=rFAltSKG1m2oenqtoIabRWHZoL/IV/CzYGCkbW9DGGU=; b=aW0iURs8qLXF5t4Jn/K2+kAFX3bm3CyzaXdMateNGsntoOiz3YUDPy13AJCbGJvtmsTKe+ EZ/8YqyWDC67LavRZWO6jz7/EuJExBQo/jzKkpPJ5lDmNhFdZLY9oXEKkZ9EVM8PTqn4Sf snfT1RNMDUmYKbjBryvPrQe+c6utPn8= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=rFAltSKG1m2oenqtoIabRWHZoL/IV/CzYGCkbW9DGGU=; b=KIbiAX9fAQ/YFzvM8+wTx/P3b4 Ft5w5WMfk+Cr2xtrmibLZ0c84Ans8HICq0Aut6t9EQiBXAE3uMO4u9rSh1mCYoBCwa1/uIZHxQgJT 4GIkGcNTmXxe7N4dr54dCqTjZVj+aUTvO82LxeZT/rT3CWMJdJD7ygzgnFRUOCkwZSl4SvoWY9+6n WWdEX+Kmw7bxcB1WXftoCCKCvAiLDB6LqjfNL+3DE6802oEstsLX/Emq46J48Iyl43u5zeq6I5Ceq vKTrn3CHYOE+7bjBfzEfie7LM9riVe+0W00gMRmxbLWz+MWispVbngD9PE4Z5GvWXH5V9LVJt98qy jXkNabUg==; Received: from [187.36.213.55] (helo=[192.168.1.103]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1t59zt-00Fprx-DZ; Sun, 27 Oct 2024 21:36:25 +0100 Message-ID: <9126583d-5865-4dcb-afe5-e846cccbea4c@igalia.com> Date: Sun, 27 Oct 2024 17:36:19 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] mm: fix the format of the kernel parameter ``thp_anon=`` To: Barry Song Cc: Jonathan Corbet , Andrew Morton , Hugh Dickins , David Hildenbrand , Ryan Roberts , Baolin Wang , Lance Yang , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-dev@igalia.com References: <20241027175743.1056710-1-mcanal@igalia.com> <20241027175743.1056710-2-mcanal@igalia.com> Content-Language: en-US From: =?UTF-8?Q?Ma=C3=ADra_Canal?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Stat-Signature: zyfx5w7sojaxyxa1ezxdu4144fhfigw7 X-Rspamd-Queue-Id: 2DB57A001B X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1730061390-133982 X-HE-Meta: U2FsdGVkX1+FeT28ZZ5oHpeuttVYVqZI68tgvFfL6KeQptDerEH0WFL45iQOvosi1lR7orqOCM1D8p8KB0dV/fxOEE/CkiHA0qwr03r6+I2hqTkEwAuTfZchahcwoeRYB5HHh1GXSZFlEgNx0p2FBgN/GJ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zDeBEtv6dUNGxaNwl8yw1GBbbJ2M71NtFJdoXtcKVfbJHt8IvkCfXrO0wq5J9r4HWbZH5p8McjRII8K70297OvnbgnxZWojQ4nEjOe2ACc4b5p3a0U2VuqKGgRlY4gZkUSnxHhLPfzwXD+lOuA6D7JQC2pzbAH7YpJHOCqYjtvuMltREPSI1gaKlo1lwZtDLEihQ= 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: Hi Barry, On 27/10/24 16:52, Barry Song wrote: > On Mon, Oct 28, 2024 at 1:58 AM Maíra Canal wrote: >> >> If we add ``thp_anon=32,64KB:always`` to the kernel command line, we >> will see the following error: >> >> [ 0.000000] huge_memory: thp_anon=32,64K:always: error parsing string, ignoring setting >> >> This happens because the correct format isn't ``thp_anon=,[KMG]:```, >> as [KMG] must follow each number to especify its unit. So, the correct >> format is ``thp_anon=[KMG],[KMG]:```. > > what if 32768,64K: always? ``32768,64K:always`` works. From the kernel parameters documentation, I see that: "Finally, the [KMG] suffix is commonly described after a number of kernel parameter values. These ‘K’, ‘M’, and ‘G’ letters represent the _binary_ multipliers ‘Kilo’, ‘Mega’, and ‘Giga’, equaling 2^10, 2^20, and 2^30 bytes respectively. Such letter suffixes can also be entirely omitted" AFAIU this means that [KMG] can be omitted if we use bytes. But if we don't use bytes, it cannot be omitted. Best Regards, - Maíra > >> >> Therefore, adjust the documentation to reflect the correct format of the >> parameter ``thp_anon=``. >> >> Fixes: dd4d30d1cdbe ("mm: override mTHP "enabled" defaults at kernel cmdline") >> Signed-off-by: Maíra Canal >> --- >> Documentation/admin-guide/kernel-parameters.txt | 2 +- >> Documentation/admin-guide/mm/transhuge.rst | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt >> index 1518343bbe22..1666576acc0e 100644 >> --- a/Documentation/admin-guide/kernel-parameters.txt >> +++ b/Documentation/admin-guide/kernel-parameters.txt >> @@ -6688,7 +6688,7 @@ >> 0: no polling (default) >> >> thp_anon= [KNL] >> - Format: ,[KMG]:;-[KMG]: >> + Format: [KMG],[KMG]:;[KMG]-[KMG]: >> state is one of "always", "madvise", "never" or "inherit". >> Control the default behavior of the system with respect >> to anonymous transparent hugepages. >> diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst >> index 203ba7aaf5fc..745055c3dc09 100644 >> --- a/Documentation/admin-guide/mm/transhuge.rst >> +++ b/Documentation/admin-guide/mm/transhuge.rst >> @@ -303,7 +303,7 @@ control by passing the parameter ``transparent_hugepage=always`` or >> kernel command line. >> >> Alternatively, each supported anonymous THP size can be controlled by >> -passing ``thp_anon=,[KMG]:;-[KMG]:``, >> +passing ``thp_anon=[KMG],[KMG]:;[KMG]-[KMG]:``, >> where ```` is the THP size (must be a power of 2 of PAGE_SIZE and >> supported anonymous THP) and ```` is one of ``always``, ``madvise``, >> ``never`` or ``inherit``. >> -- >> 2.46.2 >>