From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458Ab1HHNq7 (ORCPT ); Mon, 8 Aug 2011 09:46:59 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46922 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751524Ab1HHNq6 convert rfc822-to-8bit (ORCPT ); Mon, 8 Aug 2011 09:46:58 -0400 Subject: Re: [PATCH 2/5] writeback: dirty position control From: Peter Zijlstra To: Wu Fengguang 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 Date: Mon, 08 Aug 2011 15:46:33 +0200 In-Reply-To: <20110806094526.733282037@intel.com> References: <20110806084447.388624428@intel.com> <20110806094526.733282037@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.0.2- Message-ID: <1312811193.10488.33.camel@twins> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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 = 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 limit */ > + > + if (unlikely(dirty >= limit)) > + return 0; > + > + /* > + * global setpoint > + */ > + goal = thresh - thresh / DIRTY_SCOPE; > + origin = 4 * thresh; > + > + if (unlikely(origin < limit && dirty > (goal + origin) / 2)) { > + origin = limit; /* auxiliary control line */ > + goal = (goal + origin) / 2; > + pos_ratio >>= 1; use before init? 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail138.messagelabs.com (mail138.messagelabs.com [216.82.249.35]) by kanga.kvack.org (Postfix) with ESMTP id 355C76B0169 for ; Mon, 8 Aug 2011 09:46:56 -0400 (EDT) Subject: Re: [PATCH 2/5] writeback: dirty position control From: Peter Zijlstra Date: Mon, 08 Aug 2011 15:46:33 +0200 In-Reply-To: <20110806094526.733282037@intel.com> References: <20110806084447.388624428@intel.com> <20110806094526.733282037@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID: <1312811193.10488.33.camel@twins> Mime-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: Wu Fengguang 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 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