* [PATCH linux 5.10] RDMA/restrack: Release MR/QP restrack when delete
@ 2024-11-14 3:25 jiang.kun2
2024-11-14 11:37 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: jiang.kun2 @ 2024-11-14 3:25 UTC (permalink / raw)
To: dledford, jgg, leon, linux-rdma; +Cc: xu.xin16, tu.qiang35, jiang.kun2
From: tuqiang <tu.qiang35@zte.com.cn>
The MR/QP restrack also needs to be released when delete it, otherwise it
cause memory leak as the task struct won't be released.
Refer to commit dac153f2802d ("RDMA/restrack: Release MR restrack when delete").
Fixes: 13ef5539def7 ("RDMA/restrack: Count references to the verbs objects")
Signed-off-by: tuqiang <tu.qiang35@zte.com.cn>
Signed-off-by: Jiang Kun <jiang.kun2@zte.com.cn>
Cc: xu xin <xu.xin16@zte.com.cn>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
---
drivers/infiniband/core/restrack.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
index bbbbec5b1593..d5a69c4a1891 100644
--- a/drivers/infiniband/core/restrack.c
+++ b/drivers/infiniband/core/restrack.c
@@ -326,8 +326,6 @@ void rdma_restrack_del(struct rdma_restrack_entry *res)
rt = &dev->res[res->type];
old = xa_erase(&rt->xa, res->id);
- if (res->type == RDMA_RESTRACK_MR || res->type == RDMA_RESTRACK_QP)
- return;
WARN_ON(old != res);
res->valid = false;
--
2.18.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH linux 5.10] RDMA/restrack: Release MR/QP restrack when delete
2024-11-14 3:25 [PATCH linux 5.10] RDMA/restrack: Release MR/QP restrack when delete jiang.kun2
@ 2024-11-14 11:37 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2024-11-14 11:37 UTC (permalink / raw)
To: jiang.kun2; +Cc: dledford, jgg, linux-rdma, xu.xin16, tu.qiang35
On Thu, Nov 14, 2024 at 11:25:59AM +0800, jiang.kun2@zte.com.cn wrote:
> From: tuqiang <tu.qiang35@zte.com.cn>
>
> The MR/QP restrack also needs to be released when delete it, otherwise it
> cause memory leak as the task struct won't be released.
>
> Refer to commit dac153f2802d ("RDMA/restrack: Release MR restrack when delete").
>
> Fixes: 13ef5539def7 ("RDMA/restrack: Count references to the verbs objects")
> Signed-off-by: tuqiang <tu.qiang35@zte.com.cn>
> Signed-off-by: Jiang Kun <jiang.kun2@zte.com.cn>
> Cc: xu xin <xu.xin16@zte.com.cn>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Leon Romanovsky <leon@kernel.org>
> ---
> drivers/infiniband/core/restrack.c | 2 --
> 1 file changed, 2 deletions(-)
This is not proper way to submit patches to stable@.
Please read and Documentation/process/stable-kernel-rules.rst
Thanks
>
> diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
> index bbbbec5b1593..d5a69c4a1891 100644
> --- a/drivers/infiniband/core/restrack.c
> +++ b/drivers/infiniband/core/restrack.c
> @@ -326,8 +326,6 @@ void rdma_restrack_del(struct rdma_restrack_entry *res)
> rt = &dev->res[res->type];
>
> old = xa_erase(&rt->xa, res->id);
> - if (res->type == RDMA_RESTRACK_MR || res->type == RDMA_RESTRACK_QP)
> - return;
> WARN_ON(old != res);
> res->valid = false;
>
> --
> 2.18.4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-14 11:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14 3:25 [PATCH linux 5.10] RDMA/restrack: Release MR/QP restrack when delete jiang.kun2
2024-11-14 11:37 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).