diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2017-10-18 19:01:11 -0400 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-11-02 00:32:21 -0400 |
commit | ae89fd3de4793c0dc2ec7e9f26b58a357d74a6c7 (patch) | |
tree | ff01b76ce4885259ff750e5977bf62eb5f880e59 /drivers/md/raid1.c | |
parent | b03e0ccb5ab9df3efbe51c87843a1ffbecbafa1f (diff) |
md: use TASK_IDLE instead of blocking signals
Hi - I submit this patch for the next merge window:
Some times ago, I made a patch f9c79bc05a2a that blocks signals around the
schedule() calls in MD. The MD subsystem needs to do an uninterruptible
sleep that is not accounted in load average - so we block signals and use
interruptible sleep.
The kernel has a special TASK_IDLE state for this purpose, so we can use
it instead of blocking signals. This patch doesn't fix any bug, it just
makes the code simpler.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 9428dfa7e9a0..1f36473c79dc 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/module.h> | 37 | #include <linux/module.h> |
38 | #include <linux/seq_file.h> | 38 | #include <linux/seq_file.h> |
39 | #include <linux/ratelimit.h> | 39 | #include <linux/ratelimit.h> |
40 | #include <linux/sched/signal.h> | ||
41 | 40 | ||
42 | #include <trace/events/block.h> | 41 | #include <trace/events/block.h> |
43 | 42 | ||
@@ -1320,18 +1319,14 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio, | |||
1320 | */ | 1319 | */ |
1321 | DEFINE_WAIT(w); | 1320 | DEFINE_WAIT(w); |
1322 | for (;;) { | 1321 | for (;;) { |
1323 | sigset_t full, old; | ||
1324 | prepare_to_wait(&conf->wait_barrier, | 1322 | prepare_to_wait(&conf->wait_barrier, |
1325 | &w, TASK_INTERRUPTIBLE); | 1323 | &w, TASK_IDLE); |
1326 | if (!mddev_is_clustered(mddev) || | 1324 | if (!mddev_is_clustered(mddev) || |
1327 | !md_cluster_ops->area_resyncing(mddev, WRITE, | 1325 | !md_cluster_ops->area_resyncing(mddev, WRITE, |
1328 | bio->bi_iter.bi_sector, | 1326 | bio->bi_iter.bi_sector, |
1329 | bio_end_sector(bio))) | 1327 | bio_end_sector(bio))) |
1330 | break; | 1328 | break; |
1331 | sigfillset(&full); | ||
1332 | sigprocmask(SIG_BLOCK, &full, &old); | ||
1333 | schedule(); | 1329 | schedule(); |
1334 | sigprocmask(SIG_SETMASK, &old, NULL); | ||
1335 | } | 1330 | } |
1336 | finish_wait(&conf->wait_barrier, &w); | 1331 | finish_wait(&conf->wait_barrier, &w); |
1337 | } | 1332 | } |