diff options
| author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2013-11-22 06:52:03 -0500 |
|---|---|---|
| committer | Philipp Reisner <philipp.reisner@linbit.com> | 2014-07-10 12:35:12 -0400 |
| commit | 844a6ae7358df3261daec25e0d3a510f3d4152f2 (patch) | |
| tree | acdc6130cc3ed831dc1f5987494a241c73e0b9fa /drivers/block/drbd/drbd_int.h | |
| parent | e5f891b2234dbab8c8797111a61519d0728ef855 (diff) | |
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 { | |||
| 318 | struct list_head tl_requests; /* ring list in the transfer log */ | 318 | struct list_head tl_requests; /* ring list in the transfer log */ |
| 319 | struct bio *master_bio; /* master bio pointer */ | 319 | struct bio *master_bio; /* master bio pointer */ |
| 320 | 320 | ||
| 321 | /* see struct drbd_device */ | ||
| 322 | struct list_head req_pending_master_completion; | ||
| 323 | struct list_head req_pending_local; | ||
| 324 | |||
| 321 | /* for generic IO accounting */ | 325 | /* for generic IO accounting */ |
| 322 | unsigned long start_jif; | 326 | unsigned long start_jif; |
| 323 | 327 | ||
| @@ -738,7 +742,7 @@ struct submit_worker { | |||
| 738 | struct workqueue_struct *wq; | 742 | struct workqueue_struct *wq; |
| 739 | struct work_struct worker; | 743 | struct work_struct worker; |
| 740 | 744 | ||
| 741 | spinlock_t lock; | 745 | /* protected by ..->resource->req_lock */ |
| 742 | struct list_head writes; | 746 | struct list_head writes; |
| 743 | }; | 747 | }; |
| 744 | 748 | ||
| @@ -795,6 +799,11 @@ struct drbd_device { | |||
| 795 | struct rb_root read_requests; | 799 | struct rb_root read_requests; |
| 796 | struct rb_root write_requests; | 800 | struct rb_root write_requests; |
| 797 | 801 | ||
| 802 | /* for statistics and timeouts */ | ||
| 803 | /* [0] read, [1] write */ | ||
| 804 | struct list_head pending_master_completion[2]; | ||
| 805 | struct list_head pending_completion[2]; | ||
| 806 | |||
| 798 | /* use checksums for *this* resync */ | 807 | /* use checksums for *this* resync */ |
| 799 | bool use_csums; | 808 | bool use_csums; |
| 800 | /* blocks to resync in this run [unit BM_BLOCK_SIZE] */ | 809 | /* blocks to resync in this run [unit BM_BLOCK_SIZE] */ |
