From: Greg Kroah-Hartman Date: Sun, 31 Jul 2022 10:55:20 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v5.4.209~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3938976ca4632c146db61508b21050fbfca177e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: mt7601u-add-usb-device-id-for-some-versions-of-xiaodu-wifi-dongle.patch page_alloc-fix-invalid-watermark-check-on-a-negative-value.patch --- diff --git a/queue-5.10/mt7601u-add-usb-device-id-for-some-versions-of-xiaodu-wifi-dongle.patch b/queue-5.10/mt7601u-add-usb-device-id-for-some-versions-of-xiaodu-wifi-dongle.patch new file mode 100644 index 00000000000..c3a5b1d9a0c --- /dev/null +++ b/queue-5.10/mt7601u-add-usb-device-id-for-some-versions-of-xiaodu-wifi-dongle.patch @@ -0,0 +1,32 @@ +From 829eea7c94e0bac804e65975639a2f2e5f147033 Mon Sep 17 00:00:00 2001 +From: Wei Mingzhi +Date: Sat, 19 Jun 2021 00:08:40 +0800 +Subject: mt7601u: add USB device ID for some versions of XiaoDu WiFi Dongle. + +From: Wei Mingzhi + +commit 829eea7c94e0bac804e65975639a2f2e5f147033 upstream. + +USB device ID of some versions of XiaoDu WiFi Dongle is 2955:1003 +instead of 2955:1001. Both are the same mt7601u hardware. + +Signed-off-by: Wei Mingzhi +Acked-by: Jakub Kicinski +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20210618160840.305024-1-whistler@member.fsf.org +Cc: Yan Xinyu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/mediatek/mt7601u/usb.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/mediatek/mt7601u/usb.c ++++ b/drivers/net/wireless/mediatek/mt7601u/usb.c +@@ -26,6 +26,7 @@ static const struct usb_device_id mt7601 + { USB_DEVICE(0x2717, 0x4106) }, + { USB_DEVICE(0x2955, 0x0001) }, + { USB_DEVICE(0x2955, 0x1001) }, ++ { USB_DEVICE(0x2955, 0x1003) }, + { USB_DEVICE(0x2a5f, 0x1000) }, + { USB_DEVICE(0x7392, 0x7710) }, + { 0, } diff --git a/queue-5.10/page_alloc-fix-invalid-watermark-check-on-a-negative-value.patch b/queue-5.10/page_alloc-fix-invalid-watermark-check-on-a-negative-value.patch new file mode 100644 index 00000000000..2da53968795 --- /dev/null +++ b/queue-5.10/page_alloc-fix-invalid-watermark-check-on-a-negative-value.patch @@ -0,0 +1,70 @@ +From 9282012fc0aa248b77a69f5eb802b67c5a16bb13 Mon Sep 17 00:00:00 2001 +From: Jaewon Kim +Date: Mon, 25 Jul 2022 18:52:12 +0900 +Subject: page_alloc: fix invalid watermark check on a negative value + +From: Jaewon Kim + +commit 9282012fc0aa248b77a69f5eb802b67c5a16bb13 upstream. + +There was a report that a task is waiting at the +throttle_direct_reclaim. The pgscan_direct_throttle in vmstat was +increasing. + +This is a bug where zone_watermark_fast returns true even when the free +is very low. The commit f27ce0e14088 ("page_alloc: consider highatomic +reserve in watermark fast") changed the watermark fast to consider +highatomic reserve. But it did not handle a negative value case which +can be happened when reserved_highatomic pageblock is bigger than the +actual free. + +If watermark is considered as ok for the negative value, allocating +contexts for order-0 will consume all free pages without direct reclaim, +and finally free page may become depleted except highatomic free. + +Then allocating contexts may fall into throttle_direct_reclaim. This +symptom may easily happen in a system where wmark min is low and other +reclaimers like kswapd does not make free pages quickly. + +Handle the negative case by using MIN. + +Link: https://lkml.kernel.org/r/20220725095212.25388-1-jaewon31.kim@samsung.com +Fixes: f27ce0e14088 ("page_alloc: consider highatomic reserve in watermark fast") +Signed-off-by: Jaewon Kim +Reported-by: GyeongHwan Hong +Acked-by: Mel Gorman +Cc: Minchan Kim +Cc: Baoquan He +Cc: Vlastimil Babka +Cc: Johannes Weiner +Cc: Michal Hocko +Cc: Yong-Taek Lee +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + mm/page_alloc.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -3679,11 +3679,15 @@ static inline bool zone_watermark_fast(s + * need to be calculated. + */ + if (!order) { +- long fast_free; ++ long usable_free; ++ long reserved; + +- fast_free = free_pages; +- fast_free -= __zone_watermark_unusable_free(z, 0, alloc_flags); +- if (fast_free > mark + z->lowmem_reserve[highest_zoneidx]) ++ usable_free = free_pages; ++ reserved = __zone_watermark_unusable_free(z, 0, alloc_flags); ++ ++ /* reserved may over estimate high-atomic reserves. */ ++ usable_free -= min(usable_free, reserved); ++ if (usable_free > mark + z->lowmem_reserve[highest_zoneidx]) + return true; + } + diff --git a/queue-5.10/series b/queue-5.10/series index 91c3dda4c83..a4721159893 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -45,3 +45,5 @@ perf-symbol-correct-address-for-bss-symbols.patch sfc-disable-softirqs-for-ptp-tx.patch sctp-leave-the-err-path-free-in-sctp_stream_init-to-.patch arm-crypto-comment-out-gcc-warning-that-breaks-clang-builds.patch +page_alloc-fix-invalid-watermark-check-on-a-negative-value.patch +mt7601u-add-usb-device-id-for-some-versions-of-xiaodu-wifi-dongle.patch