@@ -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.
+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.