From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 2/5] writeback: dirty position control Date: Mon, 08 Aug 2011 15:46:33 +0200 Message-ID: <1312811193.10488.33.camel@twins> References: <20110806084447.388624428@intel.com> <20110806094526.733282037@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: linux-fsdevel@vger.kernel.org, Andrew Morton , Jan Kara , Christoph Hellwig , Dave Chinner , Greg Thelen , Minchan Kim , Vivek Goyal , Andrea Righi , linux-mm , LKML To: Wu Fengguang Return-path: In-Reply-To: <20110806094526.733282037@intel.com> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Sat, 2011-08-06 at 16:44 +0800, Wu Fengguang wrote: > +static unsigned long bdi_position_ratio(struct backing_dev_info *bdi, > + unsigned long thresh, > + unsigned long dirty, > + unsigned long bdi_thresh, > + unsigned long bdi_dirty) > +{ > + unsigned long limit =3D hard_dirty_limit(thresh); > + unsigned long origin; > + unsigned long goal; > + unsigned long long span; > + unsigned long long pos_ratio; /* for scaling up/down the rate l= imit */ > + > + if (unlikely(dirty >=3D limit)) > + return 0; > + > + /* > + * global setpoint > + */ > + goal =3D thresh - thresh / DIRTY_SCOPE; > + origin =3D 4 * thresh; > + > + if (unlikely(origin < limit && dirty > (goal + origin) / 2)) { > + origin =3D limit; /* auxiliary control li= ne */ > + goal =3D (goal + origin) / 2; > + pos_ratio >>=3D 1;=20 use before init? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. 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: email@kvack.org