diff options
author | wenxiong@linux.vnet.ibm.com <wenxiong@linux.vnet.ibm.com> | 2013-01-11 18:43:51 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-01-29 18:48:52 -0500 |
commit | 56d6aa33d3f68471466cb183d6e04b508dfb296f (patch) | |
tree | 3c13bfb4312535390b613ef31044f1af9ff9a619 /drivers/scsi/ipr.h | |
parent | 05a6538a9a204999e0c0f7faee00b81b334f4fc7 (diff) |
[SCSI] ipr: Reduce lock contention
This patch reduces lock contention while implementing distributed
completion processing.
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/ipr.h')
-rw-r--r-- | drivers/scsi/ipr.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 325cb2dd9a90..6fade571755c 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -482,17 +482,18 @@ struct ipr_hrr_queue { | |||
482 | 482 | ||
483 | struct list_head hrrq_free_q; | 483 | struct list_head hrrq_free_q; |
484 | struct list_head hrrq_pending_q; | 484 | struct list_head hrrq_pending_q; |
485 | spinlock_t _lock; | ||
486 | spinlock_t *lock; | ||
485 | 487 | ||
486 | volatile u32 toggle_bit; | 488 | volatile u32 toggle_bit; |
487 | u32 size; | 489 | u32 size; |
488 | u32 min_cmd_id; | 490 | u32 min_cmd_id; |
489 | u32 max_cmd_id; | 491 | u32 max_cmd_id; |
492 | u8 allow_interrupts:1; | ||
493 | u8 ioa_is_dead:1; | ||
494 | u8 allow_cmds:1; | ||
490 | }; | 495 | }; |
491 | 496 | ||
492 | #define for_each_hrrq(hrrq, ioa_cfg) \ | ||
493 | for (hrrq = (ioa_cfg)->hrrq; \ | ||
494 | hrrq < ((ioa_cfg)->hrrq + (ioa_cfg)->hrrq_num); hrrq++) | ||
495 | |||
496 | /* Command packet structure */ | 497 | /* Command packet structure */ |
497 | struct ipr_cmd_pkt { | 498 | struct ipr_cmd_pkt { |
498 | u8 reserved; /* Reserved by IOA */ | 499 | u8 reserved; /* Reserved by IOA */ |
@@ -1057,6 +1058,10 @@ struct ipr_hostrcb64_fabric_desc { | |||
1057 | struct ipr_hostrcb64_config_element elem[1]; | 1058 | struct ipr_hostrcb64_config_element elem[1]; |
1058 | }__attribute__((packed, aligned (8))); | 1059 | }__attribute__((packed, aligned (8))); |
1059 | 1060 | ||
1061 | #define for_each_hrrq(hrrq, ioa_cfg) \ | ||
1062 | for (hrrq = (ioa_cfg)->hrrq; \ | ||
1063 | hrrq < ((ioa_cfg)->hrrq + (ioa_cfg)->hrrq_num); hrrq++) | ||
1064 | |||
1060 | #define for_each_fabric_cfg(fabric, cfg) \ | 1065 | #define for_each_fabric_cfg(fabric, cfg) \ |
1061 | for (cfg = (fabric)->elem; \ | 1066 | for (cfg = (fabric)->elem; \ |
1062 | cfg < ((fabric)->elem + be16_to_cpu((fabric)->num_entries)); \ | 1067 | cfg < ((fabric)->elem + be16_to_cpu((fabric)->num_entries)); \ |
@@ -1411,13 +1416,10 @@ struct ipr_ioa_cfg { | |||
1411 | 1416 | ||
1412 | struct list_head queue; | 1417 | struct list_head queue; |
1413 | 1418 | ||
1414 | u8 allow_interrupts:1; | ||
1415 | u8 in_reset_reload:1; | 1419 | u8 in_reset_reload:1; |
1416 | u8 in_ioa_bringdown:1; | 1420 | u8 in_ioa_bringdown:1; |
1417 | u8 ioa_unit_checked:1; | 1421 | u8 ioa_unit_checked:1; |
1418 | u8 ioa_is_dead:1; | ||
1419 | u8 dump_taken:1; | 1422 | u8 dump_taken:1; |
1420 | u8 allow_cmds:1; | ||
1421 | u8 allow_ml_add_del:1; | 1423 | u8 allow_ml_add_del:1; |
1422 | u8 needs_hard_reset:1; | 1424 | u8 needs_hard_reset:1; |
1423 | u8 dual_raid:1; | 1425 | u8 dual_raid:1; |
@@ -1449,7 +1451,7 @@ struct ipr_ioa_cfg { | |||
1449 | char trace_start[8]; | 1451 | char trace_start[8]; |
1450 | #define IPR_TRACE_START_LABEL "trace" | 1452 | #define IPR_TRACE_START_LABEL "trace" |
1451 | struct ipr_trace_entry *trace; | 1453 | struct ipr_trace_entry *trace; |
1452 | u32 trace_index:IPR_NUM_TRACE_INDEX_BITS; | 1454 | atomic_t trace_index; |
1453 | 1455 | ||
1454 | char cfg_table_start[8]; | 1456 | char cfg_table_start[8]; |
1455 | #define IPR_CFG_TBL_START "cfg" | 1457 | #define IPR_CFG_TBL_START "cfg" |
@@ -1476,7 +1478,8 @@ struct ipr_ioa_cfg { | |||
1476 | 1478 | ||
1477 | struct ipr_hrr_queue hrrq[IPR_MAX_HRRQ_NUM]; | 1479 | struct ipr_hrr_queue hrrq[IPR_MAX_HRRQ_NUM]; |
1478 | u32 hrrq_num; | 1480 | u32 hrrq_num; |
1479 | u32 hrrq_index; | 1481 | atomic_t hrrq_index; |
1482 | u16 identify_hrrq_index; | ||
1480 | 1483 | ||
1481 | struct ipr_bus_attributes bus_attr[IPR_MAX_NUM_BUSES]; | 1484 | struct ipr_bus_attributes bus_attr[IPR_MAX_NUM_BUSES]; |
1482 | 1485 | ||