From: David Hildenbrand <david@redhat.com>
To: Barry Song <21cnbao@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
baolin.wang@linux.alibaba.com, corbet@lwn.net,
ioworker0@gmail.com, linux-kernel@vger.kernel.org,
ryan.roberts@arm.com, v-songbaohua@oppo.com
Subject: Re: [PATCH v5] mm: override mTHP "enabled" defaults at kernel cmdline
Date: Tue, 20 Aug 2024 10:15:28 +0200 [thread overview]
Message-ID: <f1fac65f-366b-4f8c-ae5a-20277a26aa60@redhat.com> (raw)
In-Reply-To: <CAGsJ_4xC+ixRB0n8yOQeQz_YndmtGcDcjjv8bLwcgmkj2XW+1w@mail.gmail.com>
long __thp_vma_allowable_orders(struct vm_area_struct *vma,>>>
unsigned long vm_flags,
>>> @@ -756,7 +757,10 @@ static int __init hugepage_init_sysfs(struct kobject **hugepage_kobj)
>>> * disable all other sizes. powerpc's PMD_ORDER isn't a compile-time
>>> * constant so we have to do this here.
>>> */
>>> - huge_anon_orders_inherit = BIT(PMD_ORDER);
>>> + if (!anon_orders_configured) {
>>> + huge_anon_orders_inherit = BIT(PMD_ORDER);
>>> + anon_orders_configured = true;
>
> I realized this is redundant since anon_orders_configured won't be
> accessed later.
> so i would like to also drop "anon_orders_configured = true" in v6.
Makes sense.
>>> +static char str_dup[PAGE_SIZE] __initdata;
>>> +static int __init setup_thp_anon(char *str)
>>> +{
>>> + char *token, *range, *policy, *subtoken;
>>> + unsigned long always, inherit, madvise;
>>> + char *start_size, *end_size;
>>> + int start, end, nr;
>>> + char *p;
>>> +
>>> + if (!str || strlen(str) + 1 > PAGE_SIZE)
>>> + goto err;
>>> + strcpy(str_dup, str);
>>> +
>>> + always = huge_anon_orders_always;
>>> + madvise = huge_anon_orders_madvise;
>>> + inherit = huge_anon_orders_inherit;
>>
>> Should we only pickup these values if "anon_orders_configured",
>> otherwise start with 0? Likely that's implicit right now.
>
> My point is that, initially, those values are always 0, so copying
> them won't cause any issues.
Right, it's more a conceptual thing: on the first cmdline configuration,
we start from scratch. Afterwards we start with the state that the
previous configuration left behind.
I'm fine with leaving it as is as well, whatever you prefer.
--
Cheers,
David / dhildenb
prev parent reply other threads:[~2024-08-20 8:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-17 4:55 [PATCH v5] mm: override mTHP "enabled" defaults at kernel cmdline Barry Song
2024-08-20 7:53 ` David Hildenbrand
2024-08-20 8:11 ` Barry Song
2024-08-20 8:15 ` David Hildenbrand [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f1fac65f-366b-4f8c-ae5a-20277a26aa60@redhat.com \
--to=david@redhat.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=corbet@lwn.net \
--cc=ioworker0@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ryan.roberts@arm.com \
--cc=v-songbaohua@oppo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).