summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/btree.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-02-21 13:39:34 -0800
committerDavid S. Miller <davem@davemloft.net>2020-02-21 13:39:34 -0800
commite65ee2fb54d4745d7b7d9061d7fe33c5c5bf3b06 (patch)
tree04b1728c397ad4604a6163529f51dfd48dfdbc07 /drivers/md/bcache/btree.c
parentb4d9785ce5c035b672f25df56706d0ff4e68b74e (diff)
parent0c0ddd6ae47c9238c18f475bcca675ca74c9dc31 (diff)
downloadlinux-stable-e65ee2fb54d4745d7b7d9061d7fe33c5c5bf3b06.tar.gz
linux-stable-e65ee2fb54d4745d7b7d9061d7fe33c5c5bf3b06.tar.bz2
linux-stable-e65ee2fb54d4745d7b7d9061d7fe33c5c5bf3b06.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Conflict resolution of ice_virtchnl_pf.c based upon work by Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/md/bcache/btree.c')
-rw-r--r--drivers/md/bcache/btree.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index fa872df4e770..b12186c87f52 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -34,6 +34,7 @@
#include <linux/random.h>
#include <linux/rcupdate.h>
#include <linux/sched/clock.h>
+#include <linux/sched/signal.h>
#include <linux/rculist.h>
#include <linux/delay.h>
#include <trace/events/bcache.h>
@@ -1913,6 +1914,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);
}