]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.5-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 May 2016 04:49:38 +0000 (00:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 May 2016 04:49:38 +0000 (00:49 -0400)
added patches:
arm-cpuidle-pass-on-arm_cpuidle_suspend-s-return-value.patch
libnvdimm-pfn-fix-memmap-reservation-sizing.patch
maintainers-remove-asterisk-from-efi-directory-names.patch
writeback-fix-performance-regression-in-wb_over_bg_thresh.patch
x86-tsc-read-all-ratio-bits-from-msr_platform_info.patch

queue-4.5/arm-cpuidle-pass-on-arm_cpuidle_suspend-s-return-value.patch [new file with mode: 0644]
queue-4.5/libnvdimm-pfn-fix-memmap-reservation-sizing.patch [new file with mode: 0644]
queue-4.5/maintainers-remove-asterisk-from-efi-directory-names.patch [new file with mode: 0644]
queue-4.5/series
queue-4.5/writeback-fix-performance-regression-in-wb_over_bg_thresh.patch [new file with mode: 0644]
queue-4.5/x86-tsc-read-all-ratio-bits-from-msr_platform_info.patch [new file with mode: 0644]

diff --git a/queue-4.5/arm-cpuidle-pass-on-arm_cpuidle_suspend-s-return-value.patch b/queue-4.5/arm-cpuidle-pass-on-arm_cpuidle_suspend-s-return-value.patch
new file mode 100644 (file)
index 0000000..b1b3f68
--- /dev/null
@@ -0,0 +1,37 @@
+From 625fe4f8ffc1b915248558481bb94249f6bd411c Mon Sep 17 00:00:00 2001
+From: James Morse <james.morse@arm.com>
+Date: Tue, 26 Apr 2016 12:15:01 +0100
+Subject: ARM: cpuidle: Pass on arm_cpuidle_suspend()'s return value
+
+From: James Morse <james.morse@arm.com>
+
+commit 625fe4f8ffc1b915248558481bb94249f6bd411c upstream.
+
+arm_cpuidle_suspend() may return -EOPNOTSUPP, or any value returned
+by the cpu_ops/cpuidle_ops suspend call. arm_enter_idle_state() doesn't
+update 'ret' with this value, meaning we always signal success to
+cpuidle_enter_state(), causing it to update the usage counters as if we
+succeeded.
+
+Fixes: 191de17aa3c1 ("ARM64: cpuidle: Replace cpu_suspend by the common ARM/ARM64 function")
+Signed-off-by: James Morse <james.morse@arm.com>
+Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpuidle/cpuidle-arm.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/cpuidle/cpuidle-arm.c
++++ b/drivers/cpuidle/cpuidle-arm.c
+@@ -50,7 +50,7 @@ static int arm_enter_idle_state(struct c
+                * call the CPU ops suspend protocol with idle index as a
+                * parameter.
+                */
+-              arm_cpuidle_suspend(idx);
++              ret = arm_cpuidle_suspend(idx);
+               cpu_pm_exit();
+       }
diff --git a/queue-4.5/libnvdimm-pfn-fix-memmap-reservation-sizing.patch b/queue-4.5/libnvdimm-pfn-fix-memmap-reservation-sizing.patch
new file mode 100644 (file)
index 0000000..e60a860
--- /dev/null
@@ -0,0 +1,64 @@
+From 658922e57b847bb7112aa67f6441b6bbc6554412 Mon Sep 17 00:00:00 2001
+From: Dan Williams <dan.j.williams@intel.com>
+Date: Sat, 30 Apr 2016 13:07:06 -0700
+Subject: libnvdimm, pfn: fix memmap reservation sizing
+
+From: Dan Williams <dan.j.williams@intel.com>
+
+commit 658922e57b847bb7112aa67f6441b6bbc6554412 upstream.
+
+When configuring a pfn-device instance to allocate the memmap array it
+needs to account for the fact that vmemmap_populate_hugepages()
+allocates struct page blocks in HPAGE_SIZE chunks.  We need to align the
+reserved area size to 2MB otherwise arch_add_memory() runs out of memory
+while establishing the memmap:
+
+ WARNING: CPU: 0 PID: 496 at arch/x86/mm/init_64.c:704 arch_add_memory+0xe7/0xf0
+ [..]
+ Call Trace:
+  [<ffffffff8148bdb3>] dump_stack+0x85/0xc2
+  [<ffffffff810a749b>] __warn+0xcb/0xf0
+  [<ffffffff810a75cd>] warn_slowpath_null+0x1d/0x20
+  [<ffffffff8106a497>] arch_add_memory+0xe7/0xf0
+  [<ffffffff811d2097>] devm_memremap_pages+0x287/0x450
+  [<ffffffff811d1ffa>] ? devm_memremap_pages+0x1ea/0x450
+  [<ffffffffa0000298>] __wrap_devm_memremap_pages+0x58/0x70 [nfit_test_iomap]
+  [<ffffffffa0047a58>] pmem_attach_disk+0x318/0x420 [nd_pmem]
+  [<ffffffffa0047bcf>] nd_pmem_probe+0x6f/0x90 [nd_pmem]
+  [<ffffffffa0009469>] nvdimm_bus_probe+0x69/0x110 [libnvdimm]
+ [..]
+  ndbus0: nd_pmem.probe(pfn3.0) = -12
+ nd_pmem: probe of pfn3.0 failed with error -12
+libndctl: ndctl_pfn_enable: pfn3.0: failed to enable
+
+Reported-by: Namratha Kothapalli <namratha.n.kothapalli@intel.com>
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+
+---
+ drivers/nvdimm/pmem.c |   13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+--- a/drivers/nvdimm/pmem.c
++++ b/drivers/nvdimm/pmem.c
+@@ -314,9 +314,16 @@ static int nd_pfn_init(struct nd_pfn *nd
+        * implementation will limit the pfns advertised through
+        * ->direct_access() to those that are included in the memmap.
+        */
+-      if (nd_pfn->mode == PFN_MODE_PMEM)
+-              offset = ALIGN(SZ_8K + 64 * npfns, nd_pfn->align);
+-      else if (nd_pfn->mode == PFN_MODE_RAM)
++      if (nd_pfn->mode == PFN_MODE_PMEM) {
++              unsigned long memmap_size;
++
++              /*
++               * vmemmap_populate_hugepages() allocates the memmap array in
++               * HPAGE_SIZE chunks.
++               */
++              memmap_size = ALIGN(64 * npfns, PMD_SIZE);
++              offset = ALIGN(SZ_8K + memmap_size, nd_pfn->align);
++      } else if (nd_pfn->mode == PFN_MODE_RAM)
+               offset = ALIGN(SZ_8K, nd_pfn->align);
+       else
+               goto err;
diff --git a/queue-4.5/maintainers-remove-asterisk-from-efi-directory-names.patch b/queue-4.5/maintainers-remove-asterisk-from-efi-directory-names.patch
new file mode 100644 (file)
index 0000000..0345829
--- /dev/null
@@ -0,0 +1,42 @@
+From e8dfe6d8f6762d515fcd4f30577f7bfcf7659887 Mon Sep 17 00:00:00 2001
+From: Matt Fleming <matt@codeblueprint.co.uk>
+Date: Tue, 3 May 2016 20:29:39 +0100
+Subject: MAINTAINERS: Remove asterisk from EFI directory names
+
+From: Matt Fleming <matt@codeblueprint.co.uk>
+
+commit e8dfe6d8f6762d515fcd4f30577f7bfcf7659887 upstream.
+
+Mark reported that having asterisks on the end of directory names
+confuses get_maintainer.pl when it encounters subdirectories, and that
+my name does not appear when run on drivers/firmware/efi/libstub.
+
+Reported-by: Mark Rutland <mark.rutland@arm.com>
+Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
+Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: linux-efi@vger.kernel.org
+Link: http://lkml.kernel.org/r/1462303781-8686-2-git-send-email-matt@codeblueprint.co.uk
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ MAINTAINERS |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -4163,8 +4163,8 @@ F:       Documentation/efi-stub.txt
+ F:    arch/ia64/kernel/efi.c
+ F:    arch/x86/boot/compressed/eboot.[ch]
+ F:    arch/x86/include/asm/efi.h
+-F:    arch/x86/platform/efi/*
+-F:    drivers/firmware/efi/*
++F:    arch/x86/platform/efi/
++F:    drivers/firmware/efi/
+ F:    include/linux/efi*.h
+ EFI VARIABLE FILESYSTEM
index 1460c7bf4fce08fc3c587f18c1debd34ce1535df..5876f507467c51018a1813f7e59d75166224900e 100644 (file)
@@ -54,3 +54,8 @@ batman-adv-fix-dat-candidate-selection-must-use-vid.patch
 batman-adv-check-skb-size-before-using-encapsulated-eth-vlan-header.patch
 batman-adv-fix-broadcast-ogm-queue-limit-on-a-removed-interface.patch
 batman-adv-reduce-refcnt-of-removed-router-when-updating-route.patch
+libnvdimm-pfn-fix-memmap-reservation-sizing.patch
+writeback-fix-performance-regression-in-wb_over_bg_thresh.patch
+maintainers-remove-asterisk-from-efi-directory-names.patch
+x86-tsc-read-all-ratio-bits-from-msr_platform_info.patch
+arm-cpuidle-pass-on-arm_cpuidle_suspend-s-return-value.patch
diff --git a/queue-4.5/writeback-fix-performance-regression-in-wb_over_bg_thresh.patch b/queue-4.5/writeback-fix-performance-regression-in-wb_over_bg_thresh.patch
new file mode 100644 (file)
index 0000000..5225a68
--- /dev/null
@@ -0,0 +1,77 @@
+From 74d369443325063a5f0260e63971decb950fd8fa Mon Sep 17 00:00:00 2001
+From: Howard Cochran <hcochran@kernelspring.com>
+Date: Thu, 10 Mar 2016 01:12:39 -0500
+Subject: writeback: Fix performance regression in wb_over_bg_thresh()
+
+From: Howard Cochran <hcochran@kernelspring.com>
+
+commit 74d369443325063a5f0260e63971decb950fd8fa upstream.
+
+Commit 947e9762a8dd ("writeback: update wb_over_bg_thresh() to use
+wb_domain aware operations") unintentionally changed this function's
+meaning from "are there more dirty pages than the background writeback
+threshold" to "are there more dirty pages than the writeback threshold".
+The background writeback threshold is typically half of the writeback
+threshold, so this had the effect of raising the number of dirty pages
+required to cause a writeback worker to perform background writeout.
+
+This can cause a very severe performance regression when a BDI uses
+BDI_CAP_STRICTLIMIT because balance_dirty_pages() and the writeback worker
+can now disagree on whether writeback should be initiated.
+
+For example, in a system having 1GB of RAM, a single spinning disk, and a
+"pass-through" FUSE filesystem mounted over the disk, application code
+mmapped a 128MB file on the disk and was randomly dirtying pages in that
+mapping.
+
+Because FUSE uses strictlimit and has a default max_ratio of only 1%, in
+balance_dirty_pages, thresh is ~200, bg_thresh is ~100, and the
+dirty_freerun_ceiling is the average of those, ~150. So, it pauses the
+dirtying processes when we have 151 dirty pages and wakes up a background
+writeback worker. But the worker tests the wrong threshold (200 instead of
+100), so it does not initiate writeback and just returns.
+
+Thus, balance_dirty_pages keeps looping, sleeping and then waking up the
+worker who will do nothing. It remains stuck in this state until the few
+dirty pages that we have finally expire and we write them back for that
+reason. Then the whole process repeats, resulting in near-zero throughput
+through the FUSE BDI.
+
+The fix is to call the parameterized variant of wb_calc_thresh, so that the
+worker will do writeback if the bg_thresh is exceeded which was the
+behavior before the referenced commit.
+
+Fixes: 947e9762a8dd ("writeback: update wb_over_bg_thresh() to use wb_domain aware operations")
+Signed-off-by: Howard Cochran <hcochran@kernelspring.com>
+Acked-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
+Tested-by Sedat Dilek <sedat.dilek@gmail.com>
+Signed-off-by: Jens Axboe <axboe@fb.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/page-writeback.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/mm/page-writeback.c
++++ b/mm/page-writeback.c
+@@ -1909,7 +1909,8 @@ bool wb_over_bg_thresh(struct bdi_writeb
+       if (gdtc->dirty > gdtc->bg_thresh)
+               return true;
+-      if (wb_stat(wb, WB_RECLAIMABLE) > __wb_calc_thresh(gdtc))
++      if (wb_stat(wb, WB_RECLAIMABLE) >
++          wb_calc_thresh(gdtc->wb, gdtc->bg_thresh))
+               return true;
+       if (mdtc) {
+@@ -1923,7 +1924,8 @@ bool wb_over_bg_thresh(struct bdi_writeb
+               if (mdtc->dirty > mdtc->bg_thresh)
+                       return true;
+-              if (wb_stat(wb, WB_RECLAIMABLE) > __wb_calc_thresh(mdtc))
++              if (wb_stat(wb, WB_RECLAIMABLE) >
++                  wb_calc_thresh(mdtc->wb, mdtc->bg_thresh))
+                       return true;
+       }
diff --git a/queue-4.5/x86-tsc-read-all-ratio-bits-from-msr_platform_info.patch b/queue-4.5/x86-tsc-read-all-ratio-bits-from-msr_platform_info.patch
new file mode 100644 (file)
index 0000000..abb500f
--- /dev/null
@@ -0,0 +1,45 @@
+From 886123fb3a8656699dff40afa0573df359abeb18 Mon Sep 17 00:00:00 2001
+From: Chen Yu <yu.c.chen@intel.com>
+Date: Fri, 6 May 2016 11:33:39 +0800
+Subject: x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO
+
+From: Chen Yu <yu.c.chen@intel.com>
+
+commit 886123fb3a8656699dff40afa0573df359abeb18 upstream.
+
+Currently we read the tsc radio: ratio = (MSR_PLATFORM_INFO >> 8) & 0x1f;
+
+Thus we get bit 8-12 of MSR_PLATFORM_INFO, however according to the SDM
+(35.5), the ratio bits are bit 8-15.
+
+Ignoring the upper bits can result in an incorrect tsc ratio, which causes the
+TSC calibration and the Local APIC timer frequency to be incorrect.
+
+Fix this problem by masking 0xff instead.
+
+[ tglx: Massaged changelog ]
+
+Fixes: 7da7c1561366 "x86, tsc: Add static (MSR) TSC calibration on Intel Atom SoCs"
+Signed-off-by: Chen Yu <yu.c.chen@intel.com>
+Cc: "Rafael J. Wysocki" <rafael@kernel.org>
+Cc: Bin Gao <bin.gao@intel.com>
+Cc: Len Brown <lenb@kernel.org>
+Link: http://lkml.kernel.org/r/1462505619-5516-1-git-send-email-yu.c.chen@intel.com
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/tsc_msr.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/tsc_msr.c
++++ b/arch/x86/kernel/tsc_msr.c
+@@ -92,7 +92,7 @@ unsigned long try_msr_calibrate_tsc(void
+       if (freq_desc_tables[cpu_index].msr_plat) {
+               rdmsr(MSR_PLATFORM_INFO, lo, hi);
+-              ratio = (lo >> 8) & 0x1f;
++              ratio = (lo >> 8) & 0xff;
+       } else {
+               rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
+               ratio = (hi >> 8) & 0x1f;