[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f1fac65f-366b-4f8c-ae5a-20277a26aa60@redhat.com>
Date: Tue, 20 Aug 2024 10:15:28 +0200
From: David Hildenbrand <david@...hat.com>
To: Barry Song <21cnbao@...il.com>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
baolin.wang@...ux.alibaba.com, corbet@....net, ioworker0@...il.com,
linux-kernel@...r.kernel.org, ryan.roberts@....com, v-songbaohua@...o.com
Subject: Re: [PATCH v5] mm: override mTHP "enabled" defaults at kernel cmdline
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
Powered by blists - more mailing lists