Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

NeilBrown and committed by
Linus Torvalds
7be3dfec 52720ae7

+3 -1
+3 -1
drivers/md/bitmap.c
··· 1045 1045 if (bitmap == NULL) 1046 1046 return; 1047 1047 if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ)) 1048 - return; 1048 + goto done; 1049 + 1049 1050 bitmap->daemon_lastrun = jiffies; 1050 1051 if (bitmap->allclean) { 1051 1052 bitmap->mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT; ··· 1143 1142 } 1144 1143 } 1145 1144 1145 + done: 1146 1146 if (bitmap->allclean == 0) 1147 1147 bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ; 1148 1148 }