DRBD does not always send UnplugRemote when it should

View: New views
2 Messages — Rating Filter:   Alert me  

DRBD does not always send UnplugRemote when it should

by Graham, Simon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In looking at DRBD performance, I noticed that DRBD does not always send
an UnplugRemote command when (I think) it should - I believe this is
because it uses the mdev UNPLUG_REMOTE flag to control whether or not
the command would be helpful and this flag is set in the worker thread
as part of actually sending the data packet.

This means that an unplug call can be made from above between the time
the bio is submitted and the time the worker thread starts processing it
- this call will be ignored because the flag it not set yet.
Subsequently, the flag gets set but it's too late by then and you can
see a very long delay on the secondary until the unplug timeout expires
there.

I think the fix is to set the flag in the queue_for_net_write action in
_req_mod - this is called inline with the bio so the flag will be set
before the unplug routine is called.

Proposed patch against 8.2 attached.
Simon



_______________________________________________
drbd-dev mailing list
drbd-dev@...
http://lists.linbit.com/mailman/listinfo/drbd-dev

unplug-remote.patch (1K) Download Attachment

Re: DRBD does not always send UnplugRemote when it should

by Lars Ellenberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 01, 2009 at 05:16:07PM -0500, Graham, Simon wrote:

> In looking at DRBD performance, I noticed that DRBD does not always send
> an UnplugRemote command when (I think) it should - I believe this is
> because it uses the mdev UNPLUG_REMOTE flag to control whether or not
> the command would be helpful and this flag is set in the worker thread
> as part of actually sending the data packet.
>
> This means that an unplug call can be made from above between the time
> the bio is submitted and the time the worker thread starts processing it
> - this call will be ignored because the flag it not set yet.
> Subsequently, the flag gets set but it's too late by then and you can
> see a very long delay on the secondary until the unplug timeout expires
> there.
>
> I think the fix is to set the flag in the queue_for_net_write action in
> _req_mod - this is called inline with the bio so the flag will be set
> before the unplug routine is called.
>
> Proposed patch against 8.2 attached.

Thanks, that looks reasonable.
I *think* we had it like that once sometime, and then changed it again.
After all, the queue_for_net_read does it, too...

Will apply to 8.3.


--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________
drbd-dev mailing list
drbd-dev@...
http://lists.linbit.com/mailman/listinfo/drbd-dev