From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: 易林 <yilin@iie.ac.cn>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Cc: "csong@cs.ucr.edu" <csong@cs.ucr.edu>,
jian liu <liujian6@iie.ac.cn>,
"zhiyunq@cs.ucr.edu" <zhiyunq@cs.ucr.edu>,
"Huang, Ray" <Ray.Huang@amd.com>,
"yiqiuping@gmail.com" <yiqiuping@gmail.com>,
"Zhang, Jerry" <Jerry.Zhang@amd.com>
Subject: Re: Need a pair decrement for fence's refcount if ttm_bo_add_move_fence failed?
Date: Mon, 8 Apr 2019 07:34:53 +0000 [thread overview]
Message-ID: <f679481d-7704-210b-fe03-8539a38ecee4@amd.com> (raw)
In-Reply-To: <31c31562.77682.169f79cfd6f.Coremail.yilin@iie.ac.cn>
Am 07.04.19 um 13:44 schrieb 易林:
> Hi, all:
> when analyzing v5.1 source code, I notice that in ttm_bo_add_move_fence,
> when reservation_object_reserve_shared failed and return ENOMEM,
> the fence's refcount increased without a pair decrement even after return to ttm_bo_add_move_fence's caller ttm_bo_mem_force_space:
>
> static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
> struct ttm_mem_type_manager *man,
> struct ttm_mem_reg *mem)
> {
> ......
> fence = dma_fence_get(man->move);
> spin_unlock(&man->move_lock);
>
> if (fence) {
> reservation_object_add_shared_fence(bo->resv, fence);
>
> ret = reservation_object_reserve_shared(bo->resv, 1);
> if (unlikely(ret))
> return ret;
>
> dma_fence_put(bo->moving);
> bo->moving = fence;
> }
>
> return 0;
> }
>
> can this lead to the imbalance of the fence's refcount? though the ENOMEN almost won't be trigger.
Yeah, the fence is leaked in the error path. Feel free to provide a
patch to fix this.
Otherwise I will provide one in the next merge window.
Thanks,
Christian.
>
> Best Regards
>
> Lin Yi
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-04-08 7:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-07 11:44 Need a pair decrement for fence's refcount if ttm_bo_add_move_fence failed? 易林
2019-04-08 7:34 ` Koenig, Christian [this message]
2019-04-09 8:21 ` 易林
2019-04-09 11:53 ` Koenig, Christian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f679481d-7704-210b-fe03-8539a38ecee4@amd.com \
--to=christian.koenig@amd.com \
--cc=Jerry.Zhang@amd.com \
--cc=Ray.Huang@amd.com \
--cc=csong@cs.ucr.edu \
--cc=dri-devel@lists.freedesktop.org \
--cc=liujian6@iie.ac.cn \
--cc=yilin@iie.ac.cn \
--cc=yiqiuping@gmail.com \
--cc=zhiyunq@cs.ucr.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).