All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: christian.koenig-5C7GfCeVMHo@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH libdrm 2/2] [RFC] amdgpu: do not free flink bo for flink_fd
Date: Mon, 13 Aug 2018 14:43:20 +0800	[thread overview]
Message-ID: <5B712888.7020908@amd.com> (raw)
In-Reply-To: <5B70F517.1010406-5C7GfCeVMHo@public.gmane.org>

On 08/13/2018 11:03 AM, Zhang, Jerry (Junwei) wrote:
> On 08/10/2018 10:20 PM, Christian König wrote:
>> Am 10.08.2018 um 07:05 schrieb Junwei Zhang:
>>> the flink bo is used to export
>>
>> Why should we do this? That makes no sense, this way we would create a memory leak.
>
> Get the thought from bo_import code, but neglected the detail of DRM_IOCTL_GEM_CLOSE IOCTL,
> that will remove the bo handle from filp->object_idr rather than filp->dev->object_name_idr.

If so, shall we close the flink bo handle(open_arg.handle) in bo import, when fails to find bo in flink handle table?
{{{
args.handle = open_arg.handle;
drmIoctl(dev->flink_fd, DRM_IOCTL_GEM_CLOSE, &args);
}}}

Regards,
Jerry

> Then make sense now. Sorry for the noise.
>
> Jerry
>
>>
>> Christian.
>>
>>>
>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>> ---
>>>   amdgpu/amdgpu_bo.c | 6 ------
>>>   1 file changed, 6 deletions(-)
>>>
>>> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
>>> index 6f0baf1..5b91cfc 100644
>>> --- a/amdgpu/amdgpu_bo.c
>>> +++ b/amdgpu/amdgpu_bo.c
>>> @@ -219,12 +219,6 @@ static int amdgpu_bo_export_flink(amdgpu_bo_handle bo)
>>>       bo->flink_name = flink.name;
>>> -    if (bo->dev->flink_fd != bo->dev->fd) {
>>> -        struct drm_gem_close args = {};
>>> -        args.handle = handle;
>>> -        drmIoctl(bo->dev->flink_fd, DRM_IOCTL_GEM_CLOSE, &args);
>>> -    }
>>> -
>>>       pthread_mutex_lock(&bo->dev->bo_table_mutex);
>>>       r = handle_table_insert(&bo->dev->bo_flink_names, bo->flink_name, bo);
>>>       pthread_mutex_unlock(&bo->dev->bo_table_mutex);
>>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-08-13  6:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-10  5:05 [PATCH libdrm 1/2] amdgpu: add a function to create amdgpu bo internally (v3) Junwei Zhang
     [not found] ` <1533877508-27480-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-08-10  5:05   ` [PATCH libdrm 2/2] [RFC] amdgpu: do not free flink bo for flink_fd Junwei Zhang
     [not found]     ` <1533877508-27480-2-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-08-10 14:20       ` Christian König
     [not found]         ` <78d960c7-6feb-9ca0-c6c8-b335a06e8f21-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-13  3:03           ` Zhang, Jerry (Junwei)
     [not found]             ` <5B70F517.1010406-5C7GfCeVMHo@public.gmane.org>
2018-08-13  6:43               ` Zhang, Jerry (Junwei) [this message]
     [not found]                 ` <5B712888.7020908-5C7GfCeVMHo@public.gmane.org>
2018-08-13  8:29                   ` Christian König
     [not found]                     ` <5cbeaa0d-a31c-96e8-d7d5-74e900985369-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-13 10:08                       ` Zhang, Jerry (Junwei)
     [not found]                         ` <5B715894.4090300-5C7GfCeVMHo@public.gmane.org>
2018-08-13 10:13                           ` Christian König
  -- strict thread matches above, loose matches on Subject: below --
2018-08-10  4:59 [PATCH libdrm 1/2] amdgpu: add a function to create amdgpu bo internally (v3) Junwei Zhang
     [not found] ` <1533877151-20165-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-08-10  4:59   ` [PATCH libdrm 2/2] [RFC] amdgpu: do not free flink bo for flink_fd Junwei Zhang

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=5B712888.7020908@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.