dm: optimize dm_mq_queue_rq()
DM multipath is the only dm-mq target. But that aside, request-based DM only supports tables with a single target that is immutable. Leverage this fact in dm_mq_queue_rq() by using the 'immutable_target' stored in the mapped_device when the table was made active. This saves the need to even take the read-side of the SRCU via dm_{get,put}_live_table. If the active DM table does not have an immutable target (e.g. "error" target was swapped in) then fallback to the slow-path where the target is looked up from the live table. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
@@ -920,6 +920,16 @@ struct target_type *dm_table_get_immutable_target_type(struct dm_table *t)
|
||||
return t->immutable_target_type;
|
||||
}
|
||||
|
||||
struct dm_target *dm_table_get_immutable_target(struct dm_table *t)
|
||||
{
|
||||
/* Immutable target is implicitly a singleton */
|
||||
if (t->num_targets > 1 ||
|
||||
!dm_target_is_immutable(t->targets[0].type))
|
||||
return NULL;
|
||||
|
||||
return t->targets;
|
||||
}
|
||||
|
||||
struct dm_target *dm_table_get_wildcard_target(struct dm_table *t)
|
||||
{
|
||||
struct dm_target *uninitialized_var(ti);
|
||||
|
Reference in New Issue
Block a user