]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.13-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Feb 2014 17:59:08 +0000 (09:59 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Feb 2014 17:59:08 +0000 (09:59 -0800)
added patches:
mm-numa-initialise-numa-balancing-after-jump-label-initialisation.patch
numa-add-a-sysctl-for-numa_balancing.patch

queue-3.13/mm-numa-initialise-numa-balancing-after-jump-label-initialisation.patch [new file with mode: 0644]
queue-3.13/numa-add-a-sysctl-for-numa_balancing.patch [new file with mode: 0644]
queue-3.13/series

diff --git a/queue-3.13/mm-numa-initialise-numa-balancing-after-jump-label-initialisation.patch b/queue-3.13/mm-numa-initialise-numa-balancing-after-jump-label-initialisation.patch
new file mode 100644 (file)
index 0000000..9466515
--- /dev/null
@@ -0,0 +1,73 @@
+From c297663c0b3930491a3cb2aba4b6e5a7159c3503 Mon Sep 17 00:00:00 2001
+From: Mel Gorman <mgorman@suse.de>
+Date: Wed, 29 Jan 2014 14:05:42 -0800
+Subject: mm: numa: initialise numa balancing after jump label initialisation
+
+From: Mel Gorman <mgorman@suse.de>
+
+commit c297663c0b3930491a3cb2aba4b6e5a7159c3503 upstream.
+
+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 kernels before commit c4b2c0c5f647 ("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>
+Acked-by: Rik van Riel <riel@redhat.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/mempolicy.c |   17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+--- a/mm/mempolicy.c
++++ b/mm/mempolicy.c
+@@ -2657,7 +2657,7 @@ void mpol_free_shared_policy(struct shar
+ }
+ #ifdef CONFIG_NUMA_BALANCING
+-static bool __initdata numabalancing_override;
++static int __initdata numabalancing_override;
+ static void __init check_numabalancing_enable(void)
+ {
+@@ -2666,9 +2666,15 @@ static void __init check_numabalancing_e
+       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 the kernel.numa_balancing sysctl");
++              printk(KERN_INFO "%s automatic NUMA balancing. "
++                      "Configure with numa_balancing= or the "
++                      "kernel.numa_balancing sysctl",
++                      numabalancing_default ? "Enabling" : "Disabling");
+               set_numabalancing_state(numabalancing_default);
+       }
+ }
+@@ -2678,13 +2684,12 @@ static int __init setup_numabalancing(ch
+       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:
diff --git a/queue-3.13/numa-add-a-sysctl-for-numa_balancing.patch b/queue-3.13/numa-add-a-sysctl-for-numa_balancing.patch
new file mode 100644 (file)
index 0000000..551b9e9
--- /dev/null
@@ -0,0 +1,106 @@
+From 54a43d54988a3731d644fdeb7a1d6f46b4ac64c7 Mon Sep 17 00:00:00 2001
+From: Andi Kleen <ak@linux.intel.com>
+Date: Thu, 23 Jan 2014 15:53:13 -0800
+Subject: numa: add a sysctl for numa_balancing
+
+From: Andi Kleen <ak@linux.intel.com>
+
+commit 54a43d54988a3731d644fdeb7a1d6f46b4ac64c7 upstream.
+
+Add a working sysctl to enable/disable automatic numa memory balancing
+at runtime.
+
+This allows us to track down performance problems with this feature and
+is generally a good idea.
+
+This was possible earlier through debugfs, but only with special
+debugging options set.  Also fix the boot message.
+
+[akpm@linux-foundation.org: s/sched_numa_balancing/sysctl_numa_balancing/]
+Signed-off-by: Andi Kleen <ak@linux.intel.com>
+Acked-by: Mel Gorman <mgorman@suse.de>
+Cc: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/sched/sysctl.h |    4 ++++
+ kernel/sched/core.c          |   24 +++++++++++++++++++++++-
+ kernel/sysctl.c              |    9 +++++++++
+ mm/mempolicy.c               |    2 +-
+ 4 files changed, 37 insertions(+), 2 deletions(-)
+
+--- a/include/linux/sched/sysctl.h
++++ b/include/linux/sched/sysctl.h
+@@ -100,4 +100,8 @@ extern int sched_rt_handler(struct ctl_t
+               void __user *buffer, size_t *lenp,
+               loff_t *ppos);
++extern int sysctl_numa_balancing(struct ctl_table *table, int write,
++                               void __user *buffer, size_t *lenp,
++                               loff_t *ppos);
++
+ #endif /* _SCHED_SYSCTL_H */
+--- a/kernel/sched/core.c
++++ b/kernel/sched/core.c
+@@ -1763,7 +1763,29 @@ void set_numabalancing_state(bool enable
+       numabalancing_enabled = enabled;
+ }
+ #endif /* CONFIG_SCHED_DEBUG */
+-#endif /* CONFIG_NUMA_BALANCING */
++
++#ifdef CONFIG_PROC_SYSCTL
++int sysctl_numa_balancing(struct ctl_table *table, int write,
++                       void __user *buffer, size_t *lenp, loff_t *ppos)
++{
++      struct ctl_table t;
++      int err;
++      int state = numabalancing_enabled;
++
++      if (write && !capable(CAP_SYS_ADMIN))
++              return -EPERM;
++
++      t = *table;
++      t.data = &state;
++      err = proc_dointvec_minmax(&t, write, buffer, lenp, ppos);
++      if (err < 0)
++              return err;
++      if (write)
++              set_numabalancing_state(state);
++      return err;
++}
++#endif
++#endif
+ /*
+  * fork()/clone()-time setup:
+--- a/kernel/sysctl.c
++++ b/kernel/sysctl.c
+@@ -398,6 +398,15 @@ static struct ctl_table kern_table[] = {
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec,
+       },
++      {
++              .procname       = "numa_balancing",
++              .data           = NULL, /* filled in by handler */
++              .maxlen         = sizeof(unsigned int),
++              .mode           = 0644,
++              .proc_handler   = sysctl_numa_balancing,
++              .extra1         = &zero,
++              .extra2         = &one,
++      },
+ #endif /* CONFIG_NUMA_BALANCING */
+ #endif /* CONFIG_SCHED_DEBUG */
+       {
+--- a/mm/mempolicy.c
++++ b/mm/mempolicy.c
+@@ -2668,7 +2668,7 @@ static void __init check_numabalancing_e
+       if (nr_node_ids > 1 && !numabalancing_override) {
+               printk(KERN_INFO "Enabling automatic NUMA balancing. "
+-                      "Configure with numa_balancing= or sysctl");
++                      "Configure with numa_balancing= or the kernel.numa_balancing sysctl");
+               set_numabalancing_state(numabalancing_default);
+       }
+ }
index 5c575bf55b190faf281dd3732e7d3ff5066279b1..9262e680deffa6b3bd69b9d33f43b31a6a0e89bd 100644 (file)
@@ -60,3 +60,5 @@ drm-radeon-warn-users-when-hw_i2c-is-enabled-v2.patch
 drm-radeon-dpm-disable-mclk-switching-on-desktop-rv770.patch
 radeon-pm-guard-access-to-rdev-pm.power_state-array.patch
 percpu_ida-make-percpu_ida_alloc-callers-accept-task-state-bitmask.patch
+numa-add-a-sysctl-for-numa_balancing.patch
+mm-numa-initialise-numa-balancing-after-jump-label-initialisation.patch