From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zimbra13.linbit.com (zimbra.linbit.com [212.69.161.123]) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTP id 6EC62101AC7E for ; Wed, 3 Sep 2014 16:22:51 +0200 (CEST) Date: Wed, 3 Sep 2014 16:22:50 +0200 From: Lars Ellenberg To: Imre Palik Message-ID: <20140903142250.GE2958@soda.linbit> References: <1409749356-5450-1-git-send-email-imrep.amz@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1409749356-5450-1-git-send-email-imrep.amz@gmail.com> Cc: linux-kernel@vger.kernel.org, "Palik, Imre" , Philipp Reisner , Matt Wilson , drbd-dev@lists.linbit.com Subject: Re: [Drbd-dev] [PATCH] drbd: fix throttling on newly created DM backing devices List-Id: "*Coordination* of development, patches, contributions -- *Questions* \(even to developers\) go to drbd-user, please." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, Sep 03, 2014 at 03:02:36PM +0200, Imre Palik wrote: > From: "Palik, Imre" > > If the drbd backing device is a new device mapper device (e.g., a > dm-linear mapping of an existing block device that contains data), the > counters are initially 0 even though the device contains useful > data. This causes throttling until something accesses the drbd device > or the backing device. > > The patch disables throttling, as long as only resync is responsible > for disk activity on a freshly created device. You are right, the !device->rs_last_events was supposed to be an indicator of "just started resync, please call once to initialize". But if curr_events stays 0, which is quite possible given the bursty nature of the DRBD resync, that will stay 0, and keep throttling. I'm not sure I like your patch, though. We may want to properly initialize rs_last_events instead. I'll think about that... Lars Ellenberg > Reported-by: Mikhail Sugakov > Cc: Matt Wilson > Signed-off-by: Imre Palik > --- > drivers/block/drbd/drbd_receiver.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c > index 9342b8d..511d2eb 100644 > --- a/drivers/block/drbd/drbd_receiver.c > +++ b/drivers/block/drbd/drbd_receiver.c > @@ -2482,7 +2482,8 @@ bool drbd_rs_c_min_rate_throttle(struct drbd_device *device) > atomic_read(&device->rs_sect_ev); > > if (atomic_read(&device->ap_actlog_cnt) > - || !device->rs_last_events || curr_events - device->rs_last_events > 64) { > + || (curr_events && (!device->rs_last_events > + || curr_events - device->rs_last_events > 64))) { > unsigned long rs_left; > int i; > > -- > 1.7.9.5 >