/* But the limit should not be set too high. Because it also controls the amount of memory which the balance_dirty_pages() caller has to write back. If this is too large then the caller will block on the IO queue all the time. So limit it to four megabytes - the balance_dirty_pages() caller will write six megabyte chunks, max.  */
void writeback_set_ratelimit(void)
/* But the limit should not be set too high. Because it also controls the amount of memory which the balance_dirty_pages() caller has to write back. If this is too large then the caller will block on the IO queue all the time. So limit it to four megabytes - the balance_dirty_pages() caller will write six megabyte chunks, max.  */
void writeback_set_ratelimit(void)
{
	ratelimit_pages = vm_total_pages / (num_online_cpus() * 32);
	if (ratelimit_pages < 16)
		ratelimit_pages = 16;
	if (ratelimit_pages * PAGE_CACHE_SIZE > 4096 * 1024)
		ratelimit_pages = (4096 * 1024) / PAGE_CACHE_SIZE;
}