All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: drbd-dev@lists.linbit.com
Subject: [PATCH 19/20] drbd: consistently use list_add_tail for peer_request tracking
Date: Tue,  1 Jul 2014 18:16:49 +0200	[thread overview]
Message-ID: <1404231410-29852-20-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1404231410-29852-1-git-send-email-philipp.reisner@linbit.com>

From: Lars Ellenberg <lars.ellenberg@linbit.com>

Keep the epoch entry lists (active_ee, read_ee, sync_ee, ...)
consistently "oldest first".  That way finding the oldest not yet
successfully processed request is simply list_first_entry_or_null.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
 drivers/block/drbd/drbd_receiver.c | 4 ++--
 drivers/block/drbd/drbd_worker.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 3a3c489..db5c580 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1777,7 +1777,7 @@ static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t secto
 	peer_req->w.cb = e_end_resync_block;
 
 	spin_lock_irq(&device->resource->req_lock);
-	list_add(&peer_req->w.list, &device->sync_ee);
+	list_add_tail(&peer_req->w.list, &device->sync_ee);
 	spin_unlock_irq(&device->resource->req_lock);
 
 	atomic_add(pi->size >> 9, &device->rs_sect_ev);
@@ -2341,7 +2341,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
 	 * active_ee to become empty in drbd_submit_peer_request();
 	 * better not add ourselves here. */
 	if ((peer_req->flags & EE_IS_TRIM_USE_ZEROOUT) == 0)
-		list_add(&peer_req->w.list, &device->active_ee);
+		list_add_tail(&peer_req->w.list, &device->active_ee);
 	spin_unlock_irq(&device->resource->req_lock);
 
 	if (device->state.conn == C_SYNC_TARGET)
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index 49b8873..ad57129 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -410,7 +410,7 @@ static int read_for_csum(struct drbd_peer_device *peer_device, sector_t sector,
 
 	peer_req->w.cb = w_e_send_csum;
 	spin_lock_irq(&device->resource->req_lock);
-	list_add(&peer_req->w.list, &device->read_ee);
+	list_add_tail(&peer_req->w.list, &device->read_ee);
 	spin_unlock_irq(&device->resource->req_lock);
 
 	atomic_add(size >> 9, &device->rs_sect_ev);
-- 
1.9.1


  parent reply	other threads:[~2014-07-01 16:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01 16:16 [PATCH 00/20] RFC DRBD fixes Philipp Reisner
2014-07-01 16:16 ` [PATCH 01/20] drbd: drop wrong debugging aid Philipp Reisner
2014-07-01 16:16 ` [PATCH 02/20] drbd: silence -Wmissing-prototypes warnings Philipp Reisner
2014-07-01 16:16 ` [PATCH 03/20] drbd: Remove unnecessary/unused code Philipp Reisner
2014-07-01 16:16 ` [PATCH 04/20] drbd: fix bogus resync stats in /proc/drbd Philipp Reisner
2014-07-01 16:16 ` [PATCH 05/20] drbd: don't implicitly resize Diskless node beyond end of device Philipp Reisner
2014-07-01 16:16 ` [PATCH 06/20] drbd: implement csums-after-crash-only Philipp Reisner
2014-07-01 16:16 ` [PATCH 07/20] drbd: Limit the time we are waiting for the first packet on an accepted socket Philipp Reisner
2014-07-01 16:16 ` [PATCH 08/20] drbd: New net configuration option socket-check-timeout Philipp Reisner
2014-07-01 16:16 ` [PATCH 09/20] drbd: application writes may set-in-sync in protocol != C Philipp Reisner
2014-07-01 16:16 ` [PATCH 10/20] drbd: short-circuit in maybe_pull_ahead Philipp Reisner
2014-07-01 16:16 ` [PATCH 11/20] drivers/block: Use RCU_INIT_POINTER(x, NULL) in drbd/drbd_state.c Philipp Reisner
2014-07-01 16:16 ` [PATCH 12/20] block: Convert last uses of __FUNCTION__ to __func__ Philipp Reisner
2014-07-01 16:16 ` [PATCH 13/20] drbd: improve resync request throttling due to sendbuf size Philipp Reisner
2014-07-01 16:16 ` [PATCH 14/20] drbd: clear CRASHED_PRIMARY only after successful resync Philipp Reisner
2014-07-01 16:16 ` [PATCH 15/20] drbd: cosmetic: change all printk(level, ...) to pr_<level>(...) Philipp Reisner
2014-07-01 16:30   ` Joe Perches
2014-07-02  9:58     ` [Drbd-dev] " Philipp Reisner
2014-07-01 16:16 ` [PATCH 16/20] drbd: drbd_rs_number_requests: fix unit mismatch in comparison Philipp Reisner
2014-07-01 16:16 ` [PATCH 17/20] drbd: add drbd_queue_work_if_unqueued helper Philipp Reisner
2014-07-01 16:16 ` [PATCH 18/20] drbd: drop drbd_md_flush Philipp Reisner
2014-07-01 16:16 ` Philipp Reisner [this message]
2014-07-01 16:16 ` [PATCH 20/20] drbd: also keep track of trim -> zero-out fallback peer_requests Philipp Reisner

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=1404231410-29852-20-git-send-email-philipp.reisner@linbit.com \
    --to=philipp.reisner@linbit.com \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 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.