All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 107403] Quadratic behavior due to leaking fence contexts in reservation objects
@ 2018-07-27 12:20 bugzilla-daemon
  2018-07-27 12:30 ` bugzilla-daemon
  2018-07-27 12:46 ` bugzilla-daemon
  0 siblings, 2 replies; 3+ messages in thread
From: bugzilla-daemon @ 2018-07-27 12:20 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1837 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=107403

            Bug ID: 107403
           Summary: Quadratic behavior due to leaking fence contexts in
                    reservation objects
           Product: DRI
           Version: XOrg git
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: DRM/AMDgpu
          Assignee: dri-devel@lists.freedesktop.org
          Reporter: bas@basnieuwenhuizen.nl

As part of the Vulkan CTS, radv creates about 30k AMDGPU contexts (about 1-20
live at the same time though).

Each of those creates a bunch of fence contexts, one for each ring, to use for
fences created from submitted jobs.

However, as part of running jobs, fences with those contexts get attached to
the
vm->root.base.bo->tbo.resv of the corresponding vm. Which means that at some
point we have tens of thousands of fences attached to it as they never get
removed. They only ever get deduplicated with a later fence from the same fence
context, so fences from destroyed contexts never get removed.

Then in amdgpu_gem_va_ioctl -> amdgpu_vm_clear_freed ->
amdgpu_vm_bo_update_mapping we do an amdgpu_sync_resv, which tries to add that
to an amdgpu_sync object. Which only has a 16-entry hashtable, so adding the
fences to the hashtable results in quadratic behavior.

Combine this with doing sparse buffer tests at the end, which do lots of VA
operations this results in tests taking 20+ minuts.

So I could reduce the number of amdgpu contexts a bit in radv, but the bigger
issue in my opnion is that we are pretty much leaking and never reclaiming the
fences.

Any idea how to best remove some signalled fences?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 3147 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug 107403] Quadratic behavior due to leaking fence contexts in reservation objects
  2018-07-27 12:20 [Bug 107403] Quadratic behavior due to leaking fence contexts in reservation objects bugzilla-daemon
@ 2018-07-27 12:30 ` bugzilla-daemon
  2018-07-27 12:46 ` bugzilla-daemon
  1 sibling, 0 replies; 3+ messages in thread
From: bugzilla-daemon @ 2018-07-27 12:30 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1926 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=107403

--- Comment #1 from Christian König <ckoenig.leichtzumerken@gmail.com> ---
Well that should be already fixed by the following commits:

commit ca25fe5efe4ab43cc5b4f3117a205c281805a5ca
Author: Christian König <ckoenig.leichtzumerken@gmail.com>
Date:   Tue Nov 14 15:24:36 2017 +0100

    dma-buf: try to replace a signaled fence in
reservation_object_add_shared_inplace

    The amdgpu issue to also need signaled fences in the reservation objects
should
    be fixed by now.

    Optimize the handling by replacing a signaled fence when adding a new
    shared one.

    Signed-off-by: Christian König <christian.koenig@amd.com>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Link:
https://patchwork.freedesktop.org/patch/msgid/20171114142436.1360-2-christian.koenig@amd.com

commit 4d9c62e8ce69d0b0a834282a34bff5ce8eeacb1d
Author: Christian König <ckoenig.leichtzumerken@gmail.com>
Date:   Tue Nov 14 15:24:35 2017 +0100

    dma-buf: keep only not signaled fence in
reservation_object_add_shared_replace v3

    The amdgpu issue to also need signaled fences in the reservation objects
    should be fixed by now.

    Optimize the list by keeping only the not signaled yet fences around.

    v2: temporary put the signaled fences at the end of the new container
    v3: put the old fence at the end of the new container as well.

    Signed-off-by: Christian König <christian.koenig@amd.com>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Link:
https://patchwork.freedesktop.org/patch/msgid/20171114142436.1360-1-christian.koenig@amd.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 3558 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug 107403] Quadratic behavior due to leaking fence contexts in reservation objects
  2018-07-27 12:20 [Bug 107403] Quadratic behavior due to leaking fence contexts in reservation objects bugzilla-daemon
  2018-07-27 12:30 ` bugzilla-daemon
@ 2018-07-27 12:46 ` bugzilla-daemon
  1 sibling, 0 replies; 3+ messages in thread
From: bugzilla-daemon @ 2018-07-27 12:46 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 634 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=107403

Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #2 from Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> ---
Hmm, seems like we were only backporting amdgpu and not the things in
drivers/dma-buf, that would explain. Thanks a lot!

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2224 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-27 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 12:20 [Bug 107403] Quadratic behavior due to leaking fence contexts in reservation objects bugzilla-daemon
2018-07-27 12:30 ` bugzilla-daemon
2018-07-27 12:46 ` bugzilla-daemon

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.