diff options
author | NeilBrown <neilb@suse.de> | 2008-03-10 14:43:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-10 21:01:19 -0400 |
commit | 7be3dfec4724c51e890455fe48fe188ad7c18b88 (patch) | |
tree | c1843e80b9b4c1de6d7603753679044d6db4c18e /drivers/md/bitmap.c | |
parent | 52720ae77d392d3f4c12281c37304edbc8cb51f1 (diff) |
md: reduce CPU wastage on idle md array with a write-intent bitmap
Recent patch titled
Reduce CPU wastage on idle md array with a write-intent bitmap.
would sometimes leave the array with dirty bitmap bits that stay dirty. A
subsequent write would sort things out so it isn't a big problem, but should
be fixed nonetheless.
We need to make sure that when the bitmap becomes not "allclean", the
daemon_sleep really does get set to a sensible value.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 831aed9c56ff..c14dacdacfac 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1045,7 +1045,8 @@ void bitmap_daemon_work(struct bitmap *bitmap) | |||
1045 | if (bitmap == NULL) | 1045 | if (bitmap == NULL) |
1046 | return; | 1046 | return; |
1047 | if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ)) | 1047 | if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ)) |
1048 | return; | 1048 | goto done; |
1049 | |||
1049 | bitmap->daemon_lastrun = jiffies; | 1050 | bitmap->daemon_lastrun = jiffies; |
1050 | if (bitmap->allclean) { | 1051 | if (bitmap->allclean) { |
1051 | bitmap->mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT; | 1052 | bitmap->mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT; |
@@ -1142,6 +1143,7 @@ void bitmap_daemon_work(struct bitmap *bitmap) | |||
1142 | } | 1143 | } |
1143 | } | 1144 | } |
1144 | 1145 | ||
1146 | done: | ||
1145 | if (bitmap->allclean == 0) | 1147 | if (bitmap->allclean == 0) |
1146 | bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ; | 1148 | bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ; |
1147 | } | 1149 | } |