Re: [PATCH 16/35] writeback: increase min pause time on concurrent dirtiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 14, 2010 at 02:23:31AM +0800, Valdis.Kletnieks@xxxxxx wrote:
> On Mon, 13 Dec 2010 22:47:02 +0800, Wu Fengguang said:
> > Target for >60ms pause time when there are 100+ heavy dirtiers per bdi.
> > (will average around 100ms given 200ms max pause time)
> 
> > --- linux-next.orig/mm/page-writeback.c	2010-12-13 21:46:16.000000000 +0800
> > +++ linux-next/mm/page-writeback.c	2010-12-13 21:46:16.000000000 +0800
> > @@ -659,6 +659,27 @@ static unsigned long max_pause(unsigned 
> >  }
> >  
> >  /*
> > + * Scale up pause time for concurrent dirtiers in order to reduce CPU overheads.
> > + * But ensure reasonably large [min_pause, max_pause] range size, so that
> > + * nr_dirtied_pause (and hence future pause time) can stay reasonably stable.
> > + */
> > +static unsigned long min_pause(struct backing_dev_info *bdi,
> > +			       unsigned long max)
> > +{
> > +	unsigned long hi = ilog2(bdi->write_bandwidth);
> > +	unsigned long lo = ilog2(bdi->throttle_bandwidth);
> > +	unsigned long t;
> > +
> > +	if (lo >= hi)
> > +		return 1;
> > +
> > +	/* (N * 10ms) on 2^N concurrent tasks */
> > +	t = (hi - lo) * (10 * HZ) / 1024;
> 
> Either I need more caffeine, or the comment doesn't match the code
> if HZ != 1000?

The "ms" in the comment may be confusing, but the pause time (t) is
measured in jiffies :)  Hope the below patch helps.

Thanks,
Fengguang
---
Subject: writeback: pause time is measured in jiffies
Date: Tue Dec 14 14:46:23 CST 2010

Add comments to make it clear.

Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
---
 mm/page-writeback.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-next.orig/mm/page-writeback.c	2010-12-14 14:45:15.000000000 +0800
+++ linux-next/mm/page-writeback.c	2010-12-14 14:46:20.000000000 +0800
@@ -649,7 +649,7 @@ unlock:
  */
 static unsigned long max_pause(unsigned long bdi_thresh)
 {
-	unsigned long t;
+	unsigned long t;  /* jiffies */
 
 	/* 1ms for every 4MB */
 	t = bdi_thresh >> (32 - PAGE_CACHE_SHIFT -
@@ -669,7 +669,7 @@ static unsigned long min_pause(struct ba
 {
 	unsigned long hi = ilog2(bdi->write_bandwidth);
 	unsigned long lo = ilog2(bdi->throttle_bandwidth);
-	unsigned long t;
+	unsigned long t;  /* jiffies */
 
 	if (lo >= hi)
 		return 1;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]