diff options
author | Muchun Song <songmuchun@bytedance.com> | 2025-02-08 17:04:16 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-02-11 13:04:11 -0700 |
commit | a052bfa636bb763786b9dc13a301a59afb03787a (patch) | |
tree | b89c2f78cebb73bb4e622ca94b8be693929e39f8 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 36d03cb3277e29beedb87b8efb1e4da02b26e0c0 (diff) |
block: refactor rq_qos_wait()
When rq_qos_wait() is first introduced, it is easy to understand. But
with some bug fixes applied, it is not easy for newcomers to understand
the whole logic under those fixes. In this patch, rq_qos_wait() is
refactored and more comments are added for better understanding. There
are 3 points for the improvement:
1) Use waitqueue_active() instead of wq_has_sleeper() to eliminate
unnecessary memory barrier in wq_has_sleeper() which is supposed
to be used in waker side. In this case, we do need the barrier.
So use the cheaper one to locklessly test for waiters on the queue.
2) Remove acquire_inflight_cb() logic for the first waiter out of the
while loop to make the code clear.
3) Add more comments to explain how to sync with different waiters and
the waker.
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20250208090416.38642-2-songmuchun@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions