From: Greg Kroah-Hartman Date: Tue, 3 Mar 2020 18:13:35 +0000 (+0100) Subject: drop bcache-ignore-pending-signals-when-creating-gc-and-a.patch from everywhere X-Git-Tag: v4.19.108~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb17351b47129501f3d45516237f9f8b0aa0ff53;p=thirdparty%2Fkernel%2Fstable-queue.git drop bcache-ignore-pending-signals-when-creating-gc-and-a.patch from everywhere --- diff --git a/queue-4.14/bcache-ignore-pending-signals-when-creating-gc-and-a.patch b/queue-4.14/bcache-ignore-pending-signals-when-creating-gc-and-a.patch deleted file mode 100644 index 497eb59fb48..00000000000 --- a/queue-4.14/bcache-ignore-pending-signals-when-creating-gc-and-a.patch +++ /dev/null @@ -1,102 +0,0 @@ -From f52c4302ac3bf412369138c1a10881090c855399 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 13 Feb 2020 22:12:05 +0800 -Subject: bcache: ignore pending signals when creating gc and allocator thread - -From: Coly Li - -[ Upstream commit 0b96da639a4874311e9b5156405f69ef9fc3bef8 ] - -When run a cache set, all the bcache btree node of this cache set will -be checked by bch_btree_check(). If the bcache btree is very large, -iterating all the btree nodes will occupy too much system memory and -the bcache registering process might be selected and killed by system -OOM killer. kthread_run() will fail if current process has pending -signal, therefore the kthread creating in run_cache_set() for gc and -allocator kernel threads are very probably failed for a very large -bcache btree. - -Indeed such OOM is safe and the registering process will exit after -the registration done. Therefore this patch flushes pending signals -during the cache set start up, specificly in bch_cache_allocator_start() -and bch_gc_thread_start(), to make sure run_cache_set() won't fail for -large cahced data set. - -Signed-off-by: Coly Li -Signed-off-by: Jens Axboe -Signed-off-by: Sasha Levin ---- - drivers/md/bcache/alloc.c | 18 ++++++++++++++++-- - drivers/md/bcache/btree.c | 13 +++++++++++++ - 2 files changed, 29 insertions(+), 2 deletions(-) - -diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c -index ada94a01e1423..9e85d44faeb49 100644 ---- a/drivers/md/bcache/alloc.c -+++ b/drivers/md/bcache/alloc.c -@@ -67,6 +67,7 @@ - #include - #include - #include -+#include - #include - - #define MAX_OPEN_BUCKETS 128 -@@ -700,8 +701,21 @@ int bch_open_buckets_alloc(struct cache_set *c) - - int bch_cache_allocator_start(struct cache *ca) - { -- struct task_struct *k = kthread_run(bch_allocator_thread, -- ca, "bcache_allocator"); -+ struct task_struct *k; -+ -+ /* -+ * In case previous btree check operation occupies too many -+ * system memory for bcache btree node cache, and the -+ * registering process is selected by OOM killer. Here just -+ * ignore the SIGKILL sent by OOM killer if there is, to -+ * avoid kthread_run() being failed by pending signals. The -+ * bcache registering process will exit after the registration -+ * done. -+ */ -+ if (signal_pending(current)) -+ flush_signals(current); -+ -+ k = kthread_run(bch_allocator_thread, ca, "bcache_allocator"); - if (IS_ERR(k)) - return PTR_ERR(k); - -diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c -index 96a6583e7b522..d61c1a4937109 100644 ---- a/drivers/md/bcache/btree.c -+++ b/drivers/md/bcache/btree.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -1801,6 +1802,18 @@ static int bch_gc_thread(void *arg) - - int bch_gc_thread_start(struct cache_set *c) - { -+ /* -+ * In case previous btree check operation occupies too many -+ * system memory for bcache btree node cache, and the -+ * registering process is selected by OOM killer. Here just -+ * ignore the SIGKILL sent by OOM killer if there is, to -+ * avoid kthread_run() being failed by pending signals. The -+ * bcache registering process will exit after the registration -+ * done. -+ */ -+ if (signal_pending(current)) -+ flush_signals(current); -+ - c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc"); - if (IS_ERR(c->gc_thread)) - return PTR_ERR(c->gc_thread); --- -2.20.1 - diff --git a/queue-4.14/series b/queue-4.14/series index dfdfd46a6ae..22165d51ee3 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -21,7 +21,6 @@ net-ena-fix-incorrectly-saving-queue-numbers-when-se.patch net-ena-ethtool-use-correct-value-for-crc32-hash.patch net-ena-ena-com.c-prevent-null-pointer-dereference.patch cifs-fix-mode-output-in-debugging-statements.patch -bcache-ignore-pending-signals-when-creating-gc-and-a.patch cfg80211-add-missing-policy-for-nl80211_attr_status_.patch sysrq-restore-original-console_loglevel-when-sysrq-disabled.patch sysrq-remove-duplicated-sysrq-message.patch diff --git a/queue-4.19/bcache-ignore-pending-signals-when-creating-gc-and-a.patch b/queue-4.19/bcache-ignore-pending-signals-when-creating-gc-and-a.patch deleted file mode 100644 index e2fa1fd8226..00000000000 --- a/queue-4.19/bcache-ignore-pending-signals-when-creating-gc-and-a.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 751e0982940bfe2ec79c6b3c5986bffb7cd3c45a Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 13 Feb 2020 22:12:05 +0800 -Subject: bcache: ignore pending signals when creating gc and allocator thread - -From: Coly Li - -[ Upstream commit 0b96da639a4874311e9b5156405f69ef9fc3bef8 ] - -When run a cache set, all the bcache btree node of this cache set will -be checked by bch_btree_check(). If the bcache btree is very large, -iterating all the btree nodes will occupy too much system memory and -the bcache registering process might be selected and killed by system -OOM killer. kthread_run() will fail if current process has pending -signal, therefore the kthread creating in run_cache_set() for gc and -allocator kernel threads are very probably failed for a very large -bcache btree. - -Indeed such OOM is safe and the registering process will exit after -the registration done. Therefore this patch flushes pending signals -during the cache set start up, specificly in bch_cache_allocator_start() -and bch_gc_thread_start(), to make sure run_cache_set() won't fail for -large cahced data set. - -Signed-off-by: Coly Li -Signed-off-by: Jens Axboe -Signed-off-by: Sasha Levin ---- - drivers/md/bcache/alloc.c | 18 ++++++++++++++++-- - drivers/md/bcache/btree.c | 13 +++++++++++++ - 2 files changed, 29 insertions(+), 2 deletions(-) - -diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c -index 46794cac167e7..2074860cbb16c 100644 ---- a/drivers/md/bcache/alloc.c -+++ b/drivers/md/bcache/alloc.c -@@ -67,6 +67,7 @@ - #include - #include - #include -+#include - #include - - #define MAX_OPEN_BUCKETS 128 -@@ -733,8 +734,21 @@ int bch_open_buckets_alloc(struct cache_set *c) - - int bch_cache_allocator_start(struct cache *ca) - { -- struct task_struct *k = kthread_run(bch_allocator_thread, -- ca, "bcache_allocator"); -+ struct task_struct *k; -+ -+ /* -+ * In case previous btree check operation occupies too many -+ * system memory for bcache btree node cache, and the -+ * registering process is selected by OOM killer. Here just -+ * ignore the SIGKILL sent by OOM killer if there is, to -+ * avoid kthread_run() being failed by pending signals. The -+ * bcache registering process will exit after the registration -+ * done. -+ */ -+ if (signal_pending(current)) -+ flush_signals(current); -+ -+ k = kthread_run(bch_allocator_thread, ca, "bcache_allocator"); - if (IS_ERR(k)) - return PTR_ERR(k); - -diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c -index bb40bd66a10e4..83d6739fd067b 100644 ---- a/drivers/md/bcache/btree.c -+++ b/drivers/md/bcache/btree.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1898,6 +1899,18 @@ static int bch_gc_thread(void *arg) - - int bch_gc_thread_start(struct cache_set *c) - { -+ /* -+ * In case previous btree check operation occupies too many -+ * system memory for bcache btree node cache, and the -+ * registering process is selected by OOM killer. Here just -+ * ignore the SIGKILL sent by OOM killer if there is, to -+ * avoid kthread_run() being failed by pending signals. The -+ * bcache registering process will exit after the registration -+ * done. -+ */ -+ if (signal_pending(current)) -+ flush_signals(current); -+ - c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc"); - return PTR_ERR_OR_ZERO(c->gc_thread); - } --- -2.20.1 - diff --git a/queue-4.19/series b/queue-4.19/series index 29a0af242aa..8da2c40c4e3 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -22,7 +22,6 @@ net-ena-fix-incorrectly-saving-queue-numbers-when-se.patch net-ena-ethtool-use-correct-value-for-crc32-hash.patch net-ena-ena-com.c-prevent-null-pointer-dereference.patch cifs-fix-mode-output-in-debugging-statements.patch -bcache-ignore-pending-signals-when-creating-gc-and-a.patch cfg80211-add-missing-policy-for-nl80211_attr_status_.patch sysrq-restore-original-console_loglevel-when-sysrq-disabled.patch sysrq-remove-duplicated-sysrq-message.patch diff --git a/queue-5.4/bcache-ignore-pending-signals-when-creating-gc-and-a.patch b/queue-5.4/bcache-ignore-pending-signals-when-creating-gc-and-a.patch deleted file mode 100644 index ac0c68518f7..00000000000 --- a/queue-5.4/bcache-ignore-pending-signals-when-creating-gc-and-a.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 5944c0fc64cccafe884a7900b09c02740ea06ef5 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 13 Feb 2020 22:12:05 +0800 -Subject: bcache: ignore pending signals when creating gc and allocator thread - -From: Coly Li - -[ Upstream commit 0b96da639a4874311e9b5156405f69ef9fc3bef8 ] - -When run a cache set, all the bcache btree node of this cache set will -be checked by bch_btree_check(). If the bcache btree is very large, -iterating all the btree nodes will occupy too much system memory and -the bcache registering process might be selected and killed by system -OOM killer. kthread_run() will fail if current process has pending -signal, therefore the kthread creating in run_cache_set() for gc and -allocator kernel threads are very probably failed for a very large -bcache btree. - -Indeed such OOM is safe and the registering process will exit after -the registration done. Therefore this patch flushes pending signals -during the cache set start up, specificly in bch_cache_allocator_start() -and bch_gc_thread_start(), to make sure run_cache_set() won't fail for -large cahced data set. - -Signed-off-by: Coly Li -Signed-off-by: Jens Axboe -Signed-off-by: Sasha Levin ---- - drivers/md/bcache/alloc.c | 18 ++++++++++++++++-- - drivers/md/bcache/btree.c | 13 +++++++++++++ - 2 files changed, 29 insertions(+), 2 deletions(-) - -diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c -index a1df0d95151c6..8bc1faf71ff2f 100644 ---- a/drivers/md/bcache/alloc.c -+++ b/drivers/md/bcache/alloc.c -@@ -67,6 +67,7 @@ - #include - #include - #include -+#include - #include - - #define MAX_OPEN_BUCKETS 128 -@@ -733,8 +734,21 @@ int bch_open_buckets_alloc(struct cache_set *c) - - int bch_cache_allocator_start(struct cache *ca) - { -- struct task_struct *k = kthread_run(bch_allocator_thread, -- ca, "bcache_allocator"); -+ struct task_struct *k; -+ -+ /* -+ * In case previous btree check operation occupies too many -+ * system memory for bcache btree node cache, and the -+ * registering process is selected by OOM killer. Here just -+ * ignore the SIGKILL sent by OOM killer if there is, to -+ * avoid kthread_run() being failed by pending signals. The -+ * bcache registering process will exit after the registration -+ * done. -+ */ -+ if (signal_pending(current)) -+ flush_signals(current); -+ -+ k = kthread_run(bch_allocator_thread, ca, "bcache_allocator"); - if (IS_ERR(k)) - return PTR_ERR(k); - -diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c -index 46a8b5a91c386..a6e05503b7723 100644 ---- a/drivers/md/bcache/btree.c -+++ b/drivers/md/bcache/btree.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1908,6 +1909,18 @@ static int bch_gc_thread(void *arg) - - int bch_gc_thread_start(struct cache_set *c) - { -+ /* -+ * In case previous btree check operation occupies too many -+ * system memory for bcache btree node cache, and the -+ * registering process is selected by OOM killer. Here just -+ * ignore the SIGKILL sent by OOM killer if there is, to -+ * avoid kthread_run() being failed by pending signals. The -+ * bcache registering process will exit after the registration -+ * done. -+ */ -+ if (signal_pending(current)) -+ flush_signals(current); -+ - c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc"); - return PTR_ERR_OR_ZERO(c->gc_thread); - } --- -2.20.1 - diff --git a/queue-5.4/series b/queue-5.4/series index dd215485300..56027c384ca 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -59,7 +59,6 @@ net-ena-ethtool-use-correct-value-for-crc32-hash.patch net-ena-ena-com.c-prevent-null-pointer-dereference.patch ice-update-unit-load-status-bitmask-to-check-after-r.patch cifs-fix-mode-output-in-debugging-statements.patch -bcache-ignore-pending-signals-when-creating-gc-and-a.patch cfg80211-add-missing-policy-for-nl80211_attr_status_.patch mac80211-fix-wrong-160-80-80-mhz-setting.patch net-hns3-add-management-table-after-imp-reset.patch diff --git a/queue-5.5/bcache-ignore-pending-signals-when-creating-gc-and-a.patch b/queue-5.5/bcache-ignore-pending-signals-when-creating-gc-and-a.patch deleted file mode 100644 index 34494e52706..00000000000 --- a/queue-5.5/bcache-ignore-pending-signals-when-creating-gc-and-a.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 429f2080e4ccd161c981ba5e0942237d81797024 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 13 Feb 2020 22:12:05 +0800 -Subject: bcache: ignore pending signals when creating gc and allocator thread - -From: Coly Li - -[ Upstream commit 0b96da639a4874311e9b5156405f69ef9fc3bef8 ] - -When run a cache set, all the bcache btree node of this cache set will -be checked by bch_btree_check(). If the bcache btree is very large, -iterating all the btree nodes will occupy too much system memory and -the bcache registering process might be selected and killed by system -OOM killer. kthread_run() will fail if current process has pending -signal, therefore the kthread creating in run_cache_set() for gc and -allocator kernel threads are very probably failed for a very large -bcache btree. - -Indeed such OOM is safe and the registering process will exit after -the registration done. Therefore this patch flushes pending signals -during the cache set start up, specificly in bch_cache_allocator_start() -and bch_gc_thread_start(), to make sure run_cache_set() won't fail for -large cahced data set. - -Signed-off-by: Coly Li -Signed-off-by: Jens Axboe -Signed-off-by: Sasha Levin ---- - drivers/md/bcache/alloc.c | 18 ++++++++++++++++-- - drivers/md/bcache/btree.c | 13 +++++++++++++ - 2 files changed, 29 insertions(+), 2 deletions(-) - -diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c -index a1df0d95151c6..8bc1faf71ff2f 100644 ---- a/drivers/md/bcache/alloc.c -+++ b/drivers/md/bcache/alloc.c -@@ -67,6 +67,7 @@ - #include - #include - #include -+#include - #include - - #define MAX_OPEN_BUCKETS 128 -@@ -733,8 +734,21 @@ int bch_open_buckets_alloc(struct cache_set *c) - - int bch_cache_allocator_start(struct cache *ca) - { -- struct task_struct *k = kthread_run(bch_allocator_thread, -- ca, "bcache_allocator"); -+ struct task_struct *k; -+ -+ /* -+ * In case previous btree check operation occupies too many -+ * system memory for bcache btree node cache, and the -+ * registering process is selected by OOM killer. Here just -+ * ignore the SIGKILL sent by OOM killer if there is, to -+ * avoid kthread_run() being failed by pending signals. The -+ * bcache registering process will exit after the registration -+ * done. -+ */ -+ if (signal_pending(current)) -+ flush_signals(current); -+ -+ k = kthread_run(bch_allocator_thread, ca, "bcache_allocator"); - if (IS_ERR(k)) - return PTR_ERR(k); - -diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c -index 14d6c33b0957e..78f0711a25849 100644 ---- a/drivers/md/bcache/btree.c -+++ b/drivers/md/bcache/btree.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1917,6 +1918,18 @@ static int bch_gc_thread(void *arg) - - int bch_gc_thread_start(struct cache_set *c) - { -+ /* -+ * In case previous btree check operation occupies too many -+ * system memory for bcache btree node cache, and the -+ * registering process is selected by OOM killer. Here just -+ * ignore the SIGKILL sent by OOM killer if there is, to -+ * avoid kthread_run() being failed by pending signals. The -+ * bcache registering process will exit after the registration -+ * done. -+ */ -+ if (signal_pending(current)) -+ flush_signals(current); -+ - c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc"); - return PTR_ERR_OR_ZERO(c->gc_thread); - } --- -2.20.1 - diff --git a/queue-5.5/series b/queue-5.5/series index ede27e583c4..d96f882d995 100644 --- a/queue-5.5/series +++ b/queue-5.5/series @@ -69,7 +69,6 @@ ice-use-ice_pf_to_dev.patch ice-use-correct-netif-error-function.patch io-wq-don-t-call-kxalloc_node-with-non-online-node.patch cifs-fix-mode-output-in-debugging-statements.patch -bcache-ignore-pending-signals-when-creating-gc-and-a.patch cfg80211-add-missing-policy-for-nl80211_attr_status_.patch mac80211-fix-wrong-160-80-80-mhz-setting.patch net-hns3-add-management-table-after-imp-reset.patch