On Sun, 2011-09-04 at 09:53 +0800, Wu Fengguang wrote: > +static unsigned long bdi_max_pause(struct backing_dev_info *bdi, > + unsigned long bdi_dirty) > +{ > + unsigned long hi = ilog2(bdi->write_bandwidth); > + unsigned long lo = ilog2(bdi->dirty_ratelimit); > + unsigned long t; > + > + /* target for ~10ms pause on 1-dd case */ > + t = HZ / 50; 1k/50 usually ends up being 20 something > + /* > + * Scale up pause time for concurrent dirtiers in order to reduce CPU > + * overheads. > + * > + * (N * 20ms) on 2^N concurrent tasks. > + */ > + if (hi > lo) > + t += (hi - lo) * (20 * HZ) / 1024; > + > + /* > + * Limit pause time for small memory systems. If sleeping for too long > + * time, a small pool of dirty/writeback pages may go empty and disk go > + * idle. > + * > + * 1ms for every 1MB; may further consider bdi bandwidth. > + */ > + if (bdi_dirty) > + t = min(t, bdi_dirty >> (30 - PAGE_CACHE_SHIFT - ilog2(HZ))); Yeah, I would add the bdi->avg_write_bandwidth term in there, 1g/s as an avg bandwidth is just too wrong.. > + > + /* > + * The pause time will be settled within range (max_pause/4, max_pause). > + * Apply a minimal value of 4 to get a non-zero max_pause/4. > + */ > + return clamp_val(t, 4, MAX_PAUSE); So you limit to 50ms min? That still seems fairly large. Is that because your min sleep granularity might be something like 10ms since you're using jiffies? > +} -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href