From: Lars Ellenberg <lars.ellenberg@linbit.com>
To: Imre Palik <imrep.amz@gmail.com>
Cc: linux-kernel@vger.kernel.org, "Palik, Imre" <imrep@amazon.de>,
Philipp Reisner <philipp.reisner@linbit.com>,
Matt Wilson <msw@amazon.com>,
drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] [PATCH] drbd: fix throttling on newly created DM backing devices
Date: Wed, 3 Sep 2014 16:22:50 +0200 [thread overview]
Message-ID: <20140903142250.GE2958@soda.linbit> (raw)
In-Reply-To: <1409749356-5450-1-git-send-email-imrep.amz@gmail.com>
On Wed, Sep 03, 2014 at 03:02:36PM +0200, Imre Palik wrote:
> From: "Palik, Imre" <imrep@amazon.de>
>
> 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 <msugakov@amazon.de>
> Cc: Matt Wilson <msw@amazon.com>
> Signed-off-by: Imre Palik <imrep@amazon.de>
> ---
> 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
>
prev parent reply other threads:[~2014-09-03 14:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 13:02 [Drbd-dev] [PATCH] drbd: fix throttling on newly created DM backing devices Imre Palik
2014-09-03 14:22 ` Lars Ellenberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140903142250.GE2958@soda.linbit \
--to=lars.ellenberg@linbit.com \
--cc=drbd-dev@lists.linbit.com \
--cc=imrep.amz@gmail.com \
--cc=imrep@amazon.de \
--cc=linux-kernel@vger.kernel.org \
--cc=msw@amazon.com \
--cc=philipp.reisner@linbit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox