Summary: | [radeon][TTM] Contention when evicting large buffers between VRAM and GTT | ||
---|---|---|---|
Product: | DRI | Reporter: | Shawn Starr <shawn.starr> |
Component: | DRM/Radeon | Assignee: | Default DRI bug account <dri-devel> |
Status: | RESOLVED WORKSFORME | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | edward.ocallaghan, julien.isorce, shawn.starr |
Version: | XOrg git | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Shawn Starr
2015-11-02 09:02:37 UTC
(In reply to Shawn Starr from comment #0) > One solution discussed is to split up the transfer into smaller chunks in > radeon_ttm. Specifically, here's how I think a fallback could be implemented in the kernel driver which can never fail because of fragmentation or resource starvation: During initialization, reserve some pinned GTT memory for bounce buffers. When a BO can't be bound to GTT for eviction as in the case reported here, instead do the eviction directly from VRAM to CPU domain in one or several passes of: 1. Copy part of the BO from VRAM to one of the reserved bounce buffers in GTT using the GPU. 2. Copy that part of the BO from the bounce buffer to the BO's system RAM pages using the CPU. (In reply to Michel Dänzer from comment #1) > (In reply to Shawn Starr from comment #0) > > One solution discussed is to split up the transfer into smaller chunks in > > radeon_ttm. > > Specifically, here's how I think a fallback could be implemented in the > kernel driver which can never fail because of fragmentation or resource > starvation: > > During initialization, reserve some pinned GTT memory for bounce buffers. > When a BO can't be bound to GTT for eviction as in the case reported here, > instead do the eviction directly from VRAM to CPU domain in one or several > passes of: > 1. Copy part of the BO from VRAM to one of the reserved bounce buffers in > GTT using the GPU. > 2. Copy that part of the BO from the bounce buffer to the BO's system RAM > pages using the CPU. if we can split a large BO to two parts, one is in VRAM, one is in GTT, seems also to be helpful for this case. Actually it doesn't need to be so complicated. Just take a look at amdgpu|radeon_move_vram_ram(). Instead of trying to reallocate and binding everything at once we just need to bind the already allocate new_mem pages page by page and copy page by page. I believe this can be closed, given the massive changes in amdgpu. I haven't seen issues anymore. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.