Re: [PATCH v5] mm: override mTHP "enabled" defaults at kernel cmdline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux