Skip to content

Commit 764b53b

Browse files
committed
Revert "bcache: ignore pending signals when creating gc and allocator thread"
This reverts commit 0b96da6. We can't just go flushing random signals, under the assumption that the OOM killer will just do something else. It's not safe from the OOM perspective, and it could also cause other signals to get randomly lost. Signed-off-by: Jens Axboe <[email protected]>
1 parent e959e54 commit 764b53b

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

drivers/md/bcache/alloc.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
#include <linux/blkdev.h>
6868
#include <linux/kthread.h>
6969
#include <linux/random.h>
70-
#include <linux/sched/signal.h>
7170
#include <trace/events/bcache.h>
7271

7372
#define MAX_OPEN_BUCKETS 128
@@ -734,21 +733,8 @@ int bch_open_buckets_alloc(struct cache_set *c)
734733

735734
int bch_cache_allocator_start(struct cache *ca)
736735
{
737-
struct task_struct *k;
738-
739-
/*
740-
* In case previous btree check operation occupies too many
741-
* system memory for bcache btree node cache, and the
742-
* registering process is selected by OOM killer. Here just
743-
* ignore the SIGKILL sent by OOM killer if there is, to
744-
* avoid kthread_run() being failed by pending signals. The
745-
* bcache registering process will exit after the registration
746-
* done.
747-
*/
748-
if (signal_pending(current))
749-
flush_signals(current);
750-
751-
k = kthread_run(bch_allocator_thread, ca, "bcache_allocator");
736+
struct task_struct *k = kthread_run(bch_allocator_thread,
737+
ca, "bcache_allocator");
752738
if (IS_ERR(k))
753739
return PTR_ERR(k);
754740

drivers/md/bcache/btree.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <linux/random.h>
3535
#include <linux/rcupdate.h>
3636
#include <linux/sched/clock.h>
37-
#include <linux/sched/signal.h>
3837
#include <linux/rculist.h>
3938
#include <linux/delay.h>
4039
#include <trace/events/bcache.h>
@@ -1914,18 +1913,6 @@ static int bch_gc_thread(void *arg)
19141913

19151914
int bch_gc_thread_start(struct cache_set *c)
19161915
{
1917-
/*
1918-
* In case previous btree check operation occupies too many
1919-
* system memory for bcache btree node cache, and the
1920-
* registering process is selected by OOM killer. Here just
1921-
* ignore the SIGKILL sent by OOM killer if there is, to
1922-
* avoid kthread_run() being failed by pending signals. The
1923-
* bcache registering process will exit after the registration
1924-
* done.
1925-
*/
1926-
if (signal_pending(current))
1927-
flush_signals(current);
1928-
19291916
c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc");
19301917
return PTR_ERR_OR_ZERO(c->gc_thread);
19311918
}

0 commit comments

Comments
 (0)