aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorMikulas Patocka <[email protected]>2017-10-18 23:01:11 +0000
committerShaohua Li <[email protected]>2017-11-02 04:32:21 +0000
commitae89fd3de4793c0dc2ec7e9f26b58a357d74a6c7 (patch)
treeff01b76ce4885259ff750e5977bf62eb5f880e59 /drivers/md/raid1.c
parentmd: remove special meaning of ->quiesce(.., 2) (diff)
downloadkernel-ae89fd3de4793c0dc2ec7e9f26b58a357d74a6c7.tar.gz
kernel-ae89fd3de4793c0dc2ec7e9f26b58a357d74a6c7.zip
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 <[email protected]> Acked-by: NeilBrown <[email protected]> Signed-off-by: Shaohua Li <[email protected]>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c7
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 @@
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/ratelimit.h>
-#include <linux/sched/signal.h>
#include <trace/events/block.h>
@@ -1320,18 +1319,14 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
*/
DEFINE_WAIT(w);
for (;;) {
- sigset_t full, old;
prepare_to_wait(&conf->wait_barrier,
- &w, TASK_INTERRUPTIBLE);
+ &w, TASK_IDLE);
if (!mddev_is_clustered(mddev) ||
!md_cluster_ops->area_resyncing(mddev, WRITE,
bio->bi_iter.bi_sector,
bio_end_sector(bio)))
break;
- sigfillset(&full);
- sigprocmask(SIG_BLOCK, &full, &old);
schedule();
- sigprocmask(SIG_SETMASK, &old, NULL);
}
finish_wait(&conf->wait_barrier, &w);
}