Draining bcache dirty data faster by setting writeback_percent to zero
Before reboots, kernel upgrades, or removing an SSD, admins want dirty data flushed from a bcache writeback cache to its backing disk. Switching to writethrough mode does not flush existing dirty data, which keeps draining through the background writeback thread at a rate limited by the controller. That controller targets a dirty-data level derived from writeback_percent, so with little dirty data its rate can fall to a floor of about 4 KiB per second. Setting writeback_percent to 0 removes that target and lets the drain run at full speed, which the author reports cleared 950 MiB across three devices in about 20 seconds. The article also notes that an idle cache set or a crowded cache can raise the rate, so the writeback_rate_debug file should be checked to see the current rate and targets.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in