Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14408
b: refs/heads/master
c: c0e4852
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Nov 18, 2005
1 parent eac6196 commit 88a66f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 34ef75f09f09611b62ae11ae36c3c7b0a6a8a9cb
refs/heads/master: c0e485216de80046dd0d448b7cd530dbfc31402f
17 changes: 13 additions & 4 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -3846,11 +3846,20 @@ static int is_mddev_idle(mddev_t *mddev)
curr_events = disk_stat_read(disk, sectors[0]) +
disk_stat_read(disk, sectors[1]) -
atomic_read(&disk->sync_io);
/* Allow some slack between valud of curr_events and last_events,
* as there are some uninteresting races.
/* The difference between curr_events and last_events
* will be affected by any new non-sync IO (making
* curr_events bigger) and any difference in the amount of
* in-flight syncio (making current_events bigger or smaller)
* The amount in-flight is currently limited to
* 32*64K in raid1/10 and 256*PAGE_SIZE in raid5/6
* which is at most 4096 sectors.
* These numbers are fairly fragile and should be made
* more robust, probably by enforcing the
* 'window size' that md_do_sync sort-of uses.
*
* Note: the following is an unsigned comparison.
*/
if ((curr_events - rdev->last_events + 32) > 64) {
if ((curr_events - rdev->last_events + 4096) > 8192) {
rdev->last_events = curr_events;
idle = 0;
}
Expand Down Expand Up @@ -4109,7 +4118,7 @@ static void md_do_sync(mddev_t *mddev)
if (currspeed > sysctl_speed_limit_min) {
if ((currspeed > sysctl_speed_limit_max) ||
!is_mddev_idle(mddev)) {
msleep(250);
msleep(500);
goto repeat;
}
}
Expand Down

0 comments on commit 88a66f2

Please sign in to comment.