mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-27 03:49:57 -04:00
drm/vmwgfx: Remove the dedicated memory accounting
vmwgfx shared very elaborate memory accounting with ttm. It was moved from ttm to vmwgfx in changef07069da6b("drm/ttm: move memory accounting into vmwgfx v4") but because of complexity it was hard to maintain. Some parts of the code weren't freeing memory correctly and some were missing accounting all together. While those would be fairly easy to fix the fundamental reason for memory accounting in the driver was the ability to invoke shrinker which is part of TTM code as well (with support for unified memory hopefully coming soon). That meant that vmwgfx had a lot of code that was either unused or duplicating code from TTM. Removing this code also prevents excessive calls to global swapout which were common during memory pressure because both vmwgfx and TTM would invoke the shrinker when memory usage reached half of RAM. Fixes:f07069da6b("drm/ttm: move memory accounting into vmwgfx v4") Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-2-zack@kde.org
This commit is contained in:
@@ -324,22 +324,3 @@ void vmw_cmdbuf_res_man_destroy(struct vmw_cmdbuf_res_manager *man)
|
||||
kfree(man);
|
||||
}
|
||||
|
||||
/**
|
||||
* vmw_cmdbuf_res_man_size - Return the size of a command buffer managed
|
||||
* resource manager
|
||||
*
|
||||
* Returns the approximate allocation size of a command buffer managed
|
||||
* resource manager.
|
||||
*/
|
||||
size_t vmw_cmdbuf_res_man_size(void)
|
||||
{
|
||||
static size_t res_man_size;
|
||||
|
||||
if (unlikely(res_man_size == 0))
|
||||
res_man_size =
|
||||
ttm_round_pot(sizeof(struct vmw_cmdbuf_res_manager)) +
|
||||
ttm_round_pot(sizeof(struct hlist_head) <<
|
||||
VMW_CMDBUF_RES_MAN_HT_ORDER);
|
||||
|
||||
return res_man_size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user