diff options
author | Md Haris Iqbal <haris.iqbal@cloud.ionos.com> | 2021-05-28 13:30:11 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-05-29 01:52:58 +0200 |
commit | 0cdfb3b20797804ae835d7a325b08d8523794089 (patch) | |
tree | ccfdc325591867027803365ebff65dd440d8ec91 /mm | |
parent | RDMA/rtrs-clt: Check state of the rtrs_clt_sess before reading its stats (diff) | |
download | linux-0cdfb3b20797804ae835d7a325b08d8523794089.tar.xz linux-0cdfb3b20797804ae835d7a325b08d8523794089.zip |
RDMA/rtrs-srv: Replace atomic_t with percpu_ref for ids_inflight
ids_inflight is used to track the inflight IOs. But the use of atomic_t
variable can cause performance drops and can also become a performance
bottleneck.
This commit replaces the use of atomic_t with a percpu_ref structure. The
advantage it offers is, it doesn't check if the reference has fallen to 0,
until the user explicitly signals it to; and that is done by the
percpu_ref_kill() function call. After that, the percpu_ref structure
behaves like an atomic_t and for every put call, checks whether the
reference has fallen to 0 or not.
rtrs_srv_stats_rdma_to_str shows the count of ids_inflight as 0
for user-mode tools not to be confused.
Fixes: 9cb837480424e ("RDMA/rtrs: server: main functionality")
Link: https://lore.kernel.org/r/20210528113018.52290-14-jinpu.wang@ionos.com
Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions