* [PATCH] mm: numa: Initialse numa balancing after jump label initialisation
@ 2014-01-27 15:51 Mel Gorman
2014-01-27 22:12 ` Rik van Riel
2014-01-27 22:43 ` Andrew Morton
0 siblings, 2 replies; 4+ messages in thread
From: Mel Gorman @ 2014-01-27 15:51 UTC (permalink / raw)
To: Andrew Morton; +Cc: Rik van Riel, linux-mm, linux-kernel
The command line parsing takes place before jump labels are initialised which
generates a warning if numa_balancing= is specified and CONFIG_JUMP_LABEL
is set. On older kernls before commit c4b2c0c5 (static_key: WARN on
usage before jump_label_init was called) the kernel would have crashed.
This patch enables automatic numa balancing later in the initialisation
process if numa_balancing= is specified.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: Stable <stable@vger.kernel.org>
---
mm/mempolicy.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 0cd2c4d..5223684 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2657,7 +2657,7 @@ void mpol_free_shared_policy(struct shared_policy *p)
}
#ifdef CONFIG_NUMA_BALANCING
-static bool __initdata numabalancing_override;
+static int __initdata numabalancing_override;
static void __init check_numabalancing_enable(void)
{
@@ -2666,9 +2666,14 @@ static void __init check_numabalancing_enable(void)
if (IS_ENABLED(CONFIG_NUMA_BALANCING_DEFAULT_ENABLED))
numabalancing_default = true;
+ /* Parsed by setup_numabalancing. override == 1 enables, -1 disables */
+ if (numabalancing_override)
+ set_numabalancing_state(numabalancing_override == 1);
+
if (nr_node_ids > 1 && !numabalancing_override) {
- printk(KERN_INFO "Enabling automatic NUMA balancing. "
- "Configure with numa_balancing= or sysctl");
+ printk(KERN_INFO "%s automatic NUMA balancing. "
+ "Configure with numa_balancing= or sysctl",
+ numabalancing_default ? "Enabling" : "Disabling");
set_numabalancing_state(numabalancing_default);
}
}
@@ -2678,13 +2683,12 @@ static int __init setup_numabalancing(char *str)
int ret = 0;
if (!str)
goto out;
- numabalancing_override = true;
if (!strcmp(str, "enable")) {
- set_numabalancing_state(true);
+ numabalancing_override = 1;
ret = 1;
} else if (!strcmp(str, "disable")) {
- set_numabalancing_state(false);
+ numabalancing_override = -1;
ret = 1;
}
out:
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm: numa: Initialse numa balancing after jump label initialisation
2014-01-27 15:51 [PATCH] mm: numa: Initialse numa balancing after jump label initialisation Mel Gorman
@ 2014-01-27 22:12 ` Rik van Riel
2014-01-27 22:43 ` Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Rik van Riel @ 2014-01-27 22:12 UTC (permalink / raw)
To: Mel Gorman, Andrew Morton; +Cc: linux-mm, linux-kernel
On 01/27/2014 10:51 AM, Mel Gorman wrote:
> The command line parsing takes place before jump labels are initialised which
> generates a warning if numa_balancing= is specified and CONFIG_JUMP_LABEL
> is set. On older kernls before commit c4b2c0c5 (static_key: WARN on
> usage before jump_label_init was called) the kernel would have crashed.
> This patch enables automatic numa balancing later in the initialisation
> process if numa_balancing= is specified.
>
> Signed-off-by: Mel Gorman <mgorman@suse.de>
> Cc: Stable <stable@vger.kernel.org>
Acked-by: Rik van Riel <riel@redhat.com>
--
All rights reversed
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm: numa: Initialse numa balancing after jump label initialisation
2014-01-27 15:51 [PATCH] mm: numa: Initialse numa balancing after jump label initialisation Mel Gorman
2014-01-27 22:12 ` Rik van Riel
@ 2014-01-27 22:43 ` Andrew Morton
2014-01-28 8:49 ` Mel Gorman
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2014-01-27 22:43 UTC (permalink / raw)
To: Mel Gorman; +Cc: Rik van Riel, linux-mm, linux-kernel
On Mon, 27 Jan 2014 15:51:27 +0000 Mel Gorman <mgorman@suse.de> wrote:
> The command line parsing takes place before jump labels are initialised which
> generates a warning if numa_balancing= is specified and CONFIG_JUMP_LABEL
> is set. On older kernls before commit c4b2c0c5 (static_key: WARN on
> usage before jump_label_init was called) the kernel would have crashed.
> This patch enables automatic numa balancing later in the initialisation
> process if numa_balancing= is specified.
>
> ...
>
> @@ -2666,9 +2666,14 @@ static void __init check_numabalancing_enable(void)
> if (IS_ENABLED(CONFIG_NUMA_BALANCING_DEFAULT_ENABLED))
> numabalancing_default = true;
>
> + /* Parsed by setup_numabalancing. override == 1 enables, -1 disables */
> + if (numabalancing_override)
> + set_numabalancing_state(numabalancing_override == 1);
> +
> if (nr_node_ids > 1 && !numabalancing_override) {
> - printk(KERN_INFO "Enabling automatic NUMA balancing. "
> - "Configure with numa_balancing= or sysctl");
> + printk(KERN_INFO "%s automatic NUMA balancing. "
> + "Configure with numa_balancing= or sysctl",
> + numabalancing_default ? "Enabling" : "Disabling");
> set_numabalancing_state(numabalancing_default);
> }
> }
Current mainline is a bit different from this:
printk(KERN_INFO "Enabling automatic NUMA balancing. "
"Configure with numa_balancing= or the kernel.numa_balancing sysctl");
So this won't apply as-is to -stable.
I assume you suggested the -stable backport to fix the
it-crashes-before-c4b2c0c5 thing, so it isn't really needed in 3.12.x.
Or something. Please sort all that out when Greg comes back with
a hey-that-didnt-apply.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm: numa: Initialse numa balancing after jump label initialisation
2014-01-27 22:43 ` Andrew Morton
@ 2014-01-28 8:49 ` Mel Gorman
0 siblings, 0 replies; 4+ messages in thread
From: Mel Gorman @ 2014-01-28 8:49 UTC (permalink / raw)
To: Andrew Morton; +Cc: Rik van Riel, linux-mm, linux-kernel
On Mon, Jan 27, 2014 at 02:43:36PM -0800, Andrew Morton wrote:
> On Mon, 27 Jan 2014 15:51:27 +0000 Mel Gorman <mgorman@suse.de> wrote:
>
> > The command line parsing takes place before jump labels are initialised which
> > generates a warning if numa_balancing= is specified and CONFIG_JUMP_LABEL
> > is set. On older kernls before commit c4b2c0c5 (static_key: WARN on
> > usage before jump_label_init was called) the kernel would have crashed.
> > This patch enables automatic numa balancing later in the initialisation
> > process if numa_balancing= is specified.
> >
> > ...
> >
> > @@ -2666,9 +2666,14 @@ static void __init check_numabalancing_enable(void)
> > if (IS_ENABLED(CONFIG_NUMA_BALANCING_DEFAULT_ENABLED))
> > numabalancing_default = true;
> >
> > + /* Parsed by setup_numabalancing. override == 1 enables, -1 disables */
> > + if (numabalancing_override)
> > + set_numabalancing_state(numabalancing_override == 1);
> > +
> > if (nr_node_ids > 1 && !numabalancing_override) {
> > - printk(KERN_INFO "Enabling automatic NUMA balancing. "
> > - "Configure with numa_balancing= or sysctl");
> > + printk(KERN_INFO "%s automatic NUMA balancing. "
> > + "Configure with numa_balancing= or sysctl",
> > + numabalancing_default ? "Enabling" : "Disabling");
> > set_numabalancing_state(numabalancing_default);
> > }
> > }
>
> Current mainline is a bit different from this:
>
> printk(KERN_INFO "Enabling automatic NUMA balancing. "
> "Configure with numa_balancing= or the kernel.numa_balancing sysctl");
>
> So this won't apply as-is to -stable.
>
That's ok.
> I assume you suggested the -stable backport to fix the
> it-crashes-before-c4b2c0c5 thing, so it isn't really needed in 3.12.x.
>
I am recommending this patch for -stable because 3.12.x crashes. c4b2c0c5
prevents a crash but it is still the case that the parameter is not handled
properly so backporting c4b2c0c5 is not a suitable alternative.
> Or something. Please sort all that out when Greg comes back with
> a hey-that-didnt-apply.
I will.
--
Mel Gorman
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-28 8:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-27 15:51 [PATCH] mm: numa: Initialse numa balancing after jump label initialisation Mel Gorman
2014-01-27 22:12 ` Rik van Riel
2014-01-27 22:43 ` Andrew Morton
2014-01-28 8:49 ` Mel Gorman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox