From: Greg Kroah-Hartman Date: Sat, 7 May 2016 04:49:38 +0000 (-0400) Subject: 4.5-stable patches X-Git-Tag: v3.14.69~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a067b381dc4d1648dd66eb7b9fe5643de232827f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.5-stable patches 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 --- 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 index 00000000000..b1b3f683387 --- /dev/null +++ b/queue-4.5/arm-cpuidle-pass-on-arm_cpuidle_suspend-s-return-value.patch @@ -0,0 +1,37 @@ +From 625fe4f8ffc1b915248558481bb94249f6bd411c Mon Sep 17 00:00:00 2001 +From: James Morse +Date: Tue, 26 Apr 2016 12:15:01 +0100 +Subject: ARM: cpuidle: Pass on arm_cpuidle_suspend()'s return value + +From: James Morse + +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 +Acked-by: Lorenzo Pieralisi +Acked-by: Daniel Lezcano +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..e60a8603e4a --- /dev/null +++ b/queue-4.5/libnvdimm-pfn-fix-memmap-reservation-sizing.patch @@ -0,0 +1,64 @@ +From 658922e57b847bb7112aa67f6441b6bbc6554412 Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Sat, 30 Apr 2016 13:07:06 -0700 +Subject: libnvdimm, pfn: fix memmap reservation sizing + +From: Dan Williams + +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: + [] dump_stack+0x85/0xc2 + [] __warn+0xcb/0xf0 + [] warn_slowpath_null+0x1d/0x20 + [] arch_add_memory+0xe7/0xf0 + [] devm_memremap_pages+0x287/0x450 + [] ? devm_memremap_pages+0x1ea/0x450 + [] __wrap_devm_memremap_pages+0x58/0x70 [nfit_test_iomap] + [] pmem_attach_disk+0x318/0x420 [nd_pmem] + [] nd_pmem_probe+0x6f/0x90 [nd_pmem] + [] 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 +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman + + +--- + 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 index 00000000000..0345829b574 --- /dev/null +++ b/queue-4.5/maintainers-remove-asterisk-from-efi-directory-names.patch @@ -0,0 +1,42 @@ +From e8dfe6d8f6762d515fcd4f30577f7bfcf7659887 Mon Sep 17 00:00:00 2001 +From: Matt Fleming +Date: Tue, 3 May 2016 20:29:39 +0100 +Subject: MAINTAINERS: Remove asterisk from EFI directory names + +From: Matt Fleming + +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 +Signed-off-by: Matt Fleming +Cc: Ard Biesheuvel +Cc: Catalin Marinas +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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 diff --git a/queue-4.5/series b/queue-4.5/series index 1460c7bf4fc..5876f507467 100644 --- a/queue-4.5/series +++ b/queue-4.5/series @@ -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 index 00000000000..5225a68d4b9 --- /dev/null +++ b/queue-4.5/writeback-fix-performance-regression-in-wb_over_bg_thresh.patch @@ -0,0 +1,77 @@ +From 74d369443325063a5f0260e63971decb950fd8fa Mon Sep 17 00:00:00 2001 +From: Howard Cochran +Date: Thu, 10 Mar 2016 01:12:39 -0500 +Subject: writeback: Fix performance regression in wb_over_bg_thresh() + +From: Howard Cochran + +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 +Acked-by: Tejun Heo +Signed-off-by: Miklos Szeredi +Tested-by Sedat Dilek +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..abb500fcbc0 --- /dev/null +++ b/queue-4.5/x86-tsc-read-all-ratio-bits-from-msr_platform_info.patch @@ -0,0 +1,45 @@ +From 886123fb3a8656699dff40afa0573df359abeb18 Mon Sep 17 00:00:00 2001 +From: Chen Yu +Date: Fri, 6 May 2016 11:33:39 +0800 +Subject: x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO + +From: Chen Yu + +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 +Cc: "Rafael J. Wysocki" +Cc: Bin Gao +Cc: Len Brown +Link: http://lkml.kernel.org/r/1462505619-5516-1-git-send-email-yu.c.chen@intel.com +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + 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;