Commit bfe1255
ublk: optimize ublk_user_copy() on daemon task
ublk user copy syscalls may be issued from any task, so they take a
reference count on the struct ublk_io to check whether it is owned by
the ublk server and prevent a concurrent UBLK_IO_COMMIT_AND_FETCH_REQ
from completing the request. However, if the user copy syscall is issued
on the io's daemon task, a concurrent UBLK_IO_COMMIT_AND_FETCH_REQ isn't
possible, so the atomic reference count dance is unnecessary. Check for
UBLK_IO_FLAG_OWNED_BY_SRV to ensure the request is dispatched to the
sever and obtain the request from ublk_io's req field instead of looking
it up on the tagset. Skip the reference count increment and decrement.
Commit 8a8fe42 ("ublk: optimize UBLK_IO_REGISTER_IO_BUF on daemon
task") made an analogous optimization for ublk zero copy buffer
registration.
Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent b2503e9 commit bfe1255
1 file changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
2698 | 2698 | | |
2699 | 2699 | | |
2700 | 2700 | | |
| 2701 | + | |
2701 | 2702 | | |
2702 | 2703 | | |
2703 | 2704 | | |
| |||
2727 | 2728 | | |
2728 | 2729 | | |
2729 | 2730 | | |
2730 | | - | |
2731 | | - | |
2732 | | - | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
2733 | 2745 | | |
2734 | 2746 | | |
2735 | 2747 | | |
| |||
2754 | 2766 | | |
2755 | 2767 | | |
2756 | 2768 | | |
2757 | | - | |
| 2769 | + | |
| 2770 | + | |
2758 | 2771 | | |
2759 | 2772 | | |
2760 | 2773 | | |
| |||
0 commit comments