Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7be3dfec authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds
Browse files

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: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 52720ae7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1045,7 +1045,8 @@ void bitmap_daemon_work(struct bitmap *bitmap)
	if (bitmap == NULL)
		return;
	if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ))
		return;
		goto done;

	bitmap->daemon_lastrun = jiffies;
	if (bitmap->allclean) {
		bitmap->mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT;
@@ -1142,6 +1143,7 @@ void bitmap_daemon_work(struct bitmap *bitmap)
		}
	}

 done:
	if (bitmap->allclean == 0)
		bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ;
}