From: Greg Kroah-Hartman Date: Sun, 18 Jun 2017 01:23:01 +0000 (+0800) Subject: 3.18-stable patches X-Git-Tag: v4.11.7~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9d29db5124c3f76a74b8a10637f05fd5f5f521b;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: mm-memory-failure.c-use-compound_head-flags-for-huge-pages.patch swap-cond_resched-in-swap_cgroup_prepare.patch usb-xhci-asmedia-asm1042a-chipset-need-shorts-tx-quirk.patch --- diff --git a/queue-3.18/mm-memory-failure.c-use-compound_head-flags-for-huge-pages.patch b/queue-3.18/mm-memory-failure.c-use-compound_head-flags-for-huge-pages.patch new file mode 100644 index 00000000000..6405e04e62f --- /dev/null +++ b/queue-3.18/mm-memory-failure.c-use-compound_head-flags-for-huge-pages.patch @@ -0,0 +1,54 @@ +From 7258ae5c5a2ce2f5969e8b18b881be40ab55433d Mon Sep 17 00:00:00 2001 +From: James Morse +Date: Fri, 16 Jun 2017 14:02:29 -0700 +Subject: mm/memory-failure.c: use compound_head() flags for huge pages + +From: James Morse + +commit 7258ae5c5a2ce2f5969e8b18b881be40ab55433d upstream. + +memory_failure() chooses a recovery action function based on the page +flags. For huge pages it uses the tail page flags which don't have +anything interesting set, resulting in: + +> Memory failure: 0x9be3b4: Unknown page state +> Memory failure: 0x9be3b4: recovery action for unknown page: Failed + +Instead, save a copy of the head page's flags if this is a huge page, +this means if there are no relevant flags for this tail page, we use the +head pages flags instead. This results in the me_huge_page() recovery +action being called: + +> Memory failure: 0x9b7969: recovery action for huge page: Delayed + +For hugepages that have not yet been allocated, this allows the hugepage +to be dequeued. + +Fixes: 524fca1e7356 ("HWPOISON: fix misjudgement of page_action() for errors on mlocked pages") +Link: http://lkml.kernel.org/r/20170524130204.21845-1-james.morse@arm.com +Signed-off-by: James Morse +Tested-by: Punit Agrawal +Acked-by: Punit Agrawal +Acked-by: Naoya Horiguchi +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/memory-failure.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/mm/memory-failure.c ++++ b/mm/memory-failure.c +@@ -1189,7 +1189,10 @@ int memory_failure(unsigned long pfn, in + * page_remove_rmap() in try_to_unmap_one(). So to determine page status + * correctly, we save a copy of the page flags at this time. + */ +- page_flags = p->flags; ++ if (PageHuge(p)) ++ page_flags = hpage->flags; ++ else ++ page_flags = p->flags; + + /* + * unpoison always clear PG_hwpoison inside page lock diff --git a/queue-3.18/series b/queue-3.18/series index 2043ebaa2ca..829b7b3d857 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -24,3 +24,6 @@ usb-gadget-dummy_hcd-fix-hub-descriptor-removable-fields.patch usb-r8a66597-hcd-select-a-different-endpoint-on-timeout.patch usb-r8a66597-hcd-decrease-timeout.patch drivers-misc-c2port-c2port-duramar2150.c-checking-for-null-instead-of-is_err.patch +usb-xhci-asmedia-asm1042a-chipset-need-shorts-tx-quirk.patch +mm-memory-failure.c-use-compound_head-flags-for-huge-pages.patch +swap-cond_resched-in-swap_cgroup_prepare.patch diff --git a/queue-3.18/swap-cond_resched-in-swap_cgroup_prepare.patch b/queue-3.18/swap-cond_resched-in-swap_cgroup_prepare.patch new file mode 100644 index 00000000000..18b281d675b --- /dev/null +++ b/queue-3.18/swap-cond_resched-in-swap_cgroup_prepare.patch @@ -0,0 +1,40 @@ +From ef70762948dde012146926720b70e79736336764 Mon Sep 17 00:00:00 2001 +From: Yu Zhao +Date: Fri, 16 Jun 2017 14:02:31 -0700 +Subject: swap: cond_resched in swap_cgroup_prepare() + +From: Yu Zhao + +commit ef70762948dde012146926720b70e79736336764 upstream. + +I saw need_resched() warnings when swapping on large swapfile (TBs) +because continuously allocating many pages in swap_cgroup_prepare() took +too long. + +We already cond_resched when freeing page in swap_cgroup_swapoff(). Do +the same for the page allocation. + +Link: http://lkml.kernel.org/r/20170604200109.17606-1-yuzhao@google.com +Signed-off-by: Yu Zhao +Acked-by: Michal Hocko +Acked-by: Vladimir Davydov +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/page_cgroup.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/mm/page_cgroup.c ++++ b/mm/page_cgroup.c +@@ -368,6 +368,9 @@ static int swap_cgroup_prepare(int type) + if (!page) + goto not_enough_page; + ctrl->map[idx] = page; ++ ++ if (!(idx % SWAP_CLUSTER_MAX)) ++ cond_resched(); + } + return 0; + not_enough_page: diff --git a/queue-3.18/usb-xhci-asmedia-asm1042a-chipset-need-shorts-tx-quirk.patch b/queue-3.18/usb-xhci-asmedia-asm1042a-chipset-need-shorts-tx-quirk.patch new file mode 100644 index 00000000000..b28557ab41a --- /dev/null +++ b/queue-3.18/usb-xhci-asmedia-asm1042a-chipset-need-shorts-tx-quirk.patch @@ -0,0 +1,35 @@ +From d2f48f05cd2a2a0a708fbfa45f1a00a87660d937 Mon Sep 17 00:00:00 2001 +From: Corentin Labbe +Date: Fri, 9 Jun 2017 14:48:41 +0300 +Subject: usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk + +From: Corentin Labbe + +commit d2f48f05cd2a2a0a708fbfa45f1a00a87660d937 upstream. + +When plugging an USB webcam I see the following message: +[106385.615559] xhci_hcd 0000:04:00.0: WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk? +[106390.583860] handle_tx_event: 913 callbacks suppressed + +With this patch applied, I get no more printing of this message. + +Signed-off-by: Corentin Labbe +Signed-off-by: Mathias Nyman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-pci.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -185,6 +185,9 @@ static void xhci_pci_quirks(struct devic + if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && + pdev->device == 0x1042) + xhci->quirks |= XHCI_BROKEN_STREAMS; ++ if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && ++ pdev->device == 0x1142) ++ xhci->quirks |= XHCI_TRUST_TX_LENGTH; + + if (xhci->quirks & XHCI_RESET_ON_RESUME) + xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,