diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2013-11-22 12:52:03 +0100 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2014-07-10 18:35:12 +0200 |
commit | 844a6ae7358df3261daec25e0d3a510f3d4152f2 (patch) | |
tree | acdc6130cc3ed831dc1f5987494a241c73e0b9fa /drivers/block/drbd/drbd_int.h | |
parent | e5f891b2234dbab8c8797111a61519d0728ef855 (diff) | |
download | linux-844a6ae7358df3261daec25e0d3a510f3d4152f2.tar.gz |
drbd: add lists to find oldest pending requests
Adding requests to per-device fifo lists as soon as possible after
allocating them leaves a simple list_first_entry_or_null() to find the
oldest request, regardless what it is still waiting for.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_int.h')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 08fa2dc8cdba..f29f107be9b8 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -318,6 +318,10 @@ struct drbd_request { struct list_head tl_requests; /* ring list in the transfer log */ struct bio *master_bio; /* master bio pointer */ + /* see struct drbd_device */ + struct list_head req_pending_master_completion; + struct list_head req_pending_local; + /* for generic IO accounting */ unsigned long start_jif; @@ -738,7 +742,7 @@ struct submit_worker { struct workqueue_struct *wq; struct work_struct worker; - spinlock_t lock; + /* protected by ..->resource->req_lock */ struct list_head writes; }; @@ -795,6 +799,11 @@ struct drbd_device { struct rb_root read_requests; struct rb_root write_requests; + /* for statistics and timeouts */ + /* [0] read, [1] write */ + struct list_head pending_master_completion[2]; + struct list_head pending_completion[2]; + /* use checksums for *this* resync */ bool use_csums; /* blocks to resync in this run [unit BM_BLOCK_SIZE] */ |