Commit 1d9d5241 authored by NeilBrown's avatar NeilBrown

md/raid1/raid10: add a cond_resched

During 'check' of a raid1 or raid10 it is possible for the management
thread to spend a lot of time running 'memcmp' on blocks from
different devices, so make sure the thread has a chance to schedule.
raid5d already has a cond_resched (in process_stripe).
Reported-By: default avatarLee Howard <faxguy@howardsilvan.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 1442577b
...@@ -1683,6 +1683,7 @@ static void raid1d(mddev_t *mddev) ...@@ -1683,6 +1683,7 @@ static void raid1d(mddev_t *mddev)
generic_make_request(bio); generic_make_request(bio);
} }
} }
cond_resched();
} }
if (unplug) if (unplug)
unplug_slaves(mddev); unplug_slaves(mddev);
......
...@@ -1632,6 +1632,7 @@ static void raid10d(mddev_t *mddev) ...@@ -1632,6 +1632,7 @@ static void raid10d(mddev_t *mddev)
generic_make_request(bio); generic_make_request(bio);
} }
} }
cond_resched();
} }
if (unplug) if (unplug)
unplug_slaves(mddev); unplug_slaves(mddev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment