aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index adf960d8a7c9..78c7418478d6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3156,7 +3156,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
3156 if (cnt > 0 ) { 3156 if (cnt > 0 ) {
3157 printk(KERN_WARNING 3157 printk(KERN_WARNING
3158 "md: %s(pid %d) used deprecated START_ARRAY ioctl. " 3158 "md: %s(pid %d) used deprecated START_ARRAY ioctl. "
3159 "This will not be supported beyond 2.6\n", 3159 "This will not be supported beyond July 2006\n",
3160 current->comm, current->pid); 3160 current->comm, current->pid);
3161 cnt--; 3161 cnt--;
3162 } 3162 }
@@ -3437,10 +3437,19 @@ static int md_thread(void * arg)
3437 allow_signal(SIGKILL); 3437 allow_signal(SIGKILL);
3438 while (!kthread_should_stop()) { 3438 while (!kthread_should_stop()) {
3439 3439
3440 wait_event_timeout(thread->wqueue, 3440 /* We need to wait INTERRUPTIBLE so that
3441 test_bit(THREAD_WAKEUP, &thread->flags) 3441 * we don't add to the load-average.
3442 || kthread_should_stop(), 3442 * That means we need to be sure no signals are
3443 thread->timeout); 3443 * pending
3444 */
3445 if (signal_pending(current))
3446 flush_signals(current);
3447
3448 wait_event_interruptible_timeout
3449 (thread->wqueue,
3450 test_bit(THREAD_WAKEUP, &thread->flags)
3451 || kthread_should_stop(),
3452 thread->timeout);
3444 try_to_freeze(); 3453 try_to_freeze();
3445 3454
3446 clear_bit(THREAD_WAKEUP, &thread->flags); 3455 clear_bit(THREAD_WAKEUP, &thread->flags);
@@ -3837,11 +3846,20 @@ static int is_mddev_idle(mddev_t *mddev)
3837 curr_events = disk_stat_read(disk, sectors[0]) + 3846 curr_events = disk_stat_read(disk, sectors[0]) +
3838 disk_stat_read(disk, sectors[1]) - 3847 disk_stat_read(disk, sectors[1]) -
3839 atomic_read(&disk->sync_io); 3848 atomic_read(&disk->sync_io);
3840 /* Allow some slack between valud of curr_events and last_events, 3849 /* The difference between curr_events and last_events
3841 * as there are some uninteresting races. 3850 * will be affected by any new non-sync IO (making
3851 * curr_events bigger) and any difference in the amount of
3852 * in-flight syncio (making current_events bigger or smaller)
3853 * The amount in-flight is currently limited to
3854 * 32*64K in raid1/10 and 256*PAGE_SIZE in raid5/6
3855 * which is at most 4096 sectors.
3856 * These numbers are fairly fragile and should be made
3857 * more robust, probably by enforcing the
3858 * 'window size' that md_do_sync sort-of uses.
3859 *
3842 * Note: the following is an unsigned comparison. 3860 * Note: the following is an unsigned comparison.
3843 */ 3861 */
3844 if ((curr_events - rdev->last_events + 32) > 64) { 3862 if ((curr_events - rdev->last_events + 4096) > 8192) {
3845 rdev->last_events = curr_events; 3863 rdev->last_events = curr_events;
3846 idle = 0; 3864 idle = 0;
3847 } 3865 }
@@ -4100,7 +4118,7 @@ static void md_do_sync(mddev_t *mddev)
4100 if (currspeed > sysctl_speed_limit_min) { 4118 if (currspeed > sysctl_speed_limit_min) {
4101 if ((currspeed > sysctl_speed_limit_max) || 4119 if ((currspeed > sysctl_speed_limit_max) ||
4102 !is_mddev_idle(mddev)) { 4120 !is_mddev_idle(mddev)) {
4103 msleep(250); 4121 msleep(500);
4104 goto repeat; 4122 goto repeat;
4105 } 4123 }
4106 } 4124 }