Commit 8d077ed
scsi: ufs: Optimize the command queueing code
Remove the clock scaling lock from ufshcd_queuecommand() since it is a
performance bottleneck. Instead check the SCSI device budget bitmaps in the
code that waits for ongoing ufshcd_queuecommand() calls. A bit is set in
sdev->budget_map just before scsi_queue_rq() is called and a bit is cleared
from that bitmap if scsi_queue_rq() does not submit the request or after
the request has finished. See also the blk_mq_{get,put}_dispatch_budget()
calls in the block layer.
There is no risk for a livelock since the block layer delays queue reruns
if queueing a request fails because the SCSI host has been blocked.
Link: https://lore.kernel.org/r/[email protected]
Cc: Asutosh Das (asd) <[email protected]>
Reviewed-by: Asutosh Das <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent 5675c38 commit 8d077ed
2 files changed
+24
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1073 | 1091 | | |
1074 | 1092 | | |
1075 | 1093 | | |
1076 | 1094 | | |
1077 | 1095 | | |
1078 | 1096 | | |
1079 | | - | |
| 1097 | + | |
1080 | 1098 | | |
1081 | 1099 | | |
1082 | 1100 | | |
| |||
1094 | 1112 | | |
1095 | 1113 | | |
1096 | 1114 | | |
1097 | | - | |
1098 | | - | |
| 1115 | + | |
| 1116 | + | |
1099 | 1117 | | |
1100 | 1118 | | |
1101 | 1119 | | |
| |||
1115 | 1133 | | |
1116 | 1134 | | |
1117 | 1135 | | |
1118 | | - | |
| 1136 | + | |
1119 | 1137 | | |
1120 | 1138 | | |
1121 | 1139 | | |
1122 | 1140 | | |
1123 | | - | |
| 1141 | + | |
1124 | 1142 | | |
1125 | 1143 | | |
1126 | 1144 | | |
| |||
2681 | 2699 | | |
2682 | 2700 | | |
2683 | 2701 | | |
2684 | | - | |
2685 | | - | |
2686 | | - | |
2687 | 2702 | | |
2688 | 2703 | | |
2689 | 2704 | | |
| |||
2772 | 2787 | | |
2773 | 2788 | | |
2774 | 2789 | | |
2775 | | - | |
2776 | | - | |
2777 | 2790 | | |
2778 | 2791 | | |
2779 | 2792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
781 | 782 | | |
782 | 783 | | |
783 | 784 | | |
| |||
0 commit comments