-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhpsa-attempt-to-fix-qdepth-calculations-for-logical-drives
71 lines (65 loc) · 2.33 KB
/
hpsa-attempt-to-fix-qdepth-calculations-for-logical-drives
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
hpsa: attempt to fix queue depth calculations for logical drives
From: Stephen M. Cameron <[email protected]>
Signed-off-by: Stephen M. Cameron <[email protected]>
---
drivers/scsi/hpsa.c | 33 +++++++++++++++------------------
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 61c8d97..b2d5c6f 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1540,11 +1540,12 @@ static void hpsa_figure_phys_disk_ptrs(struct ctlr_info *h,
int i, j;
int nraid_map_entries = map->row_cnt * map->layout_map_count *
(map->data_disks_per_row + map->metadata_disks_per_row);
+ int qdepth;
if (nraid_map_entries > RAID_MAP_MAX_ENTRIES)
nraid_map_entries = RAID_MAP_MAX_ENTRIES;
- logical_drive->queue_depth = 0;
+ qdepth = 0;
for (i = 0; i < nraid_map_entries; i++) {
logical_drive->phys_disk[i] = NULL;
if (!logical_drive->offload_config)
@@ -1554,17 +1555,13 @@ static void hpsa_figure_phys_disk_ptrs(struct ctlr_info *h,
continue;
if (is_logical_dev_addr_mode(dev[j]->scsi3addr))
continue;
- if (dev[j]->ioaccel_handle == dd[i].ioaccel_handle) {
- logical_drive->phys_disk[i] = dev[j];
- logical_drive->queue_depth = min(h->nr_cmds,
- logical_drive->queue_depth +
- logical_drive->phys_disk[i]->queue_depth);
- dev_info(&h->pdev->dev,
- "setting phys_disk[%d] to dev[%d]=%p, qd=%d\n",
- i, j, dev[j],
- logical_drive->queue_depth); /* ROBROB development only - remove this print */
- break;
- }
+ if (dev[j]->ioaccel_handle != dd[i].ioaccel_handle)
+ continue;
+
+ logical_drive->phys_disk[i] = dev[j];
+ qdepth = min(h->nr_cmds, qdepth +
+ logical_drive->phys_disk[i]->queue_depth);
+ break;
}
/*
@@ -1580,12 +1577,12 @@ static void hpsa_figure_phys_disk_ptrs(struct ctlr_info *h,
logical_drive->queue_depth = h->nr_cmds;
}
}
- if (nraid_map_entries)
- /* exclude parity drives from calculation */
- logical_drive->queue_depth = min(h->nr_cmds,
- logical_drive->queue_depth *
- logical_drive->raid_map.data_disks_per_row /
- nraid_map_entries);
+ if (nraid_map_entries)
+ /*
+ * This is correct for reads, too high for full stripe writes,
+ * way too high for partial stripe writes
+ */
+ logical_drive->queue_depth = qdepth;
else
logical_drive->queue_depth = h->nr_cmds;
}