diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-10-17 13:56:53 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-10-23 23:21:52 -0400 |
commit | 35e0e757537b9239172e35db773dd062727fd612 (patch) | |
tree | 3a54e1e426f1a962219325eac474b715a4699924 /include/target | |
parent | 59aaad1ec44d9a77c32b873b001f31c5af47fcc7 (diff) |
target: use a workqueue for I/O completions
Instead of abusing the target processing thread for offloading I/O
completion in the backends to user context add a new workqueue. This means
completions can be processed as fast as available CPU time allows it,
including in parallel with other completions and more importantly I/O
submission or QUEUE FULL retries. This should give much better performance
especially on loaded systems.
As a fallout we can merge all the completed states into a single
one.
On the downside this change complicates lun reset handling a bit by
requiring us to cancel a work item only for those states that have it
initialized. The alternative would be to either always initialize the work
item to a dummy handler, or always use the same handler and do a switch on
the state. The long term solution will be a flag that says that the command
has an initialized work item, but that's only going to be useful once we
have more users.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 07104bf0a9c8..8e2c83d4fbad 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -86,9 +86,7 @@ enum transport_state_table { | |||
86 | TRANSPORT_WRITE_PENDING = 3, | 86 | TRANSPORT_WRITE_PENDING = 3, |
87 | TRANSPORT_PROCESS_WRITE = 4, | 87 | TRANSPORT_PROCESS_WRITE = 4, |
88 | TRANSPORT_PROCESSING = 5, | 88 | TRANSPORT_PROCESSING = 5, |
89 | TRANSPORT_COMPLETE_OK = 6, | 89 | TRANSPORT_COMPLETE = 6, |
90 | TRANSPORT_COMPLETE_FAILURE = 7, | ||
91 | TRANSPORT_COMPLETE_TIMEOUT = 8, | ||
92 | TRANSPORT_PROCESS_TMR = 9, | 90 | TRANSPORT_PROCESS_TMR = 9, |
93 | TRANSPORT_ISTATE_PROCESSING = 11, | 91 | TRANSPORT_ISTATE_PROCESSING = 11, |
94 | TRANSPORT_NEW_CMD_MAP = 16, | 92 | TRANSPORT_NEW_CMD_MAP = 16, |
@@ -492,6 +490,8 @@ struct se_cmd { | |||
492 | struct completion transport_lun_stop_comp; | 490 | struct completion transport_lun_stop_comp; |
493 | struct scatterlist *t_tasks_sg_chained; | 491 | struct scatterlist *t_tasks_sg_chained; |
494 | 492 | ||
493 | struct work_struct work; | ||
494 | |||
495 | /* | 495 | /* |
496 | * Used for pre-registered fabric SGL passthrough WRITE and READ | 496 | * Used for pre-registered fabric SGL passthrough WRITE and READ |
497 | * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop | 497 | * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop |