All of lore.kernel.org
 help / color / mirror / Atom feed
* [Drbd-dev] [PATCH] DRBD 8.0; Make sure barrier is sent after last data block in epoch
@ 2008-01-27 15:48 Graham, Simon
  2008-01-29 13:37 ` Philipp Reisner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Graham, Simon @ 2008-01-27 15:48 UTC (permalink / raw)
  To: drbd-dev


[-- Attachment #1.1: Type: text/plain, Size: 346 bytes --]

With the new barrier implementation, the code that checks if the size of
the current epoch has hit it's max will queue the work item to send the
barrier BEFORE queuing the workitem to send the last data block in the
epoch which is a problem!

 

Attached patch fixes this by queuing the barrier work item after the
data.

 

Simon


[-- Attachment #1.2: Type: text/html, Size: 3696 bytes --]

[-- Attachment #2: 0001-Make-sure-barrier-is-sent-AFTER-last-data-block-in-e.patch --]
[-- Type: application/octet-stream, Size: 1279 bytes --]

From a474ee80088835f6504a401841fc7eb9e9ed0d9e Mon Sep 17 00:00:00 2001
From: Simon P. Graham <Simon.Graham@stratus.com>
Date: Sun, 27 Jan 2008 10:31:34 -0500
Subject: [PATCH] Make sure barrier is sent AFTER last data block in epoch

---
 drbd/drbd_req.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drbd/drbd_req.c b/drbd/drbd_req.c
index 8a6f7af..ef39455 100644
--- a/drbd/drbd_req.c
+++ b/drbd/drbd_req.c
@@ -612,14 +612,19 @@ void _req_mod(drbd_request_t *req, drbd_req_event_t what, int error)
 		req->epoch = mdev->newest_barrier->br_number;
 		list_add_tail(&req->tl_requests,&mdev->newest_barrier->requests);
 
-		/* close the epoch, in case it outgrew the limit */
-		if( ++mdev->newest_barrier->n_req >= mdev->net_conf->max_epoch_size )
-			queue_barrier(mdev);
+		/* increment size of current epoch */
+		mdev->newest_barrier->n_req++;
 
+		/* queue work item to send data */
 		D_ASSERT(req->rq_state & RQ_NET_PENDING);
 		req->rq_state |= RQ_NET_QUEUED;
 		req->w.cb =  w_send_dblock;
 		drbd_queue_work(&mdev->data.work, &req->w);
+
+		/* close the epoch, in case it outgrew the limit */
+		if( mdev->newest_barrier->n_req >= mdev->net_conf->max_epoch_size )
+			queue_barrier(mdev);
+
 		break;
 
 	/* FIXME
-- 
1.5.4-rc2.GIT


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-03-31 17:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-27 15:48 [Drbd-dev] [PATCH] DRBD 8.0; Make sure barrier is sent after last data block in epoch Graham, Simon
2008-01-29 13:37 ` Philipp Reisner
2008-01-29 19:40 ` Graham, Simon
2008-02-12 23:55 ` [Drbd-dev] Stuck in WFBitMapS again Montrose, Ernest
2008-02-18 13:05   ` Philipp Reisner
2008-03-31 14:43   ` Philipp Reisner
2008-03-31 17:12   ` Montrose, Ernest

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.