diff options
author | Zack Rusin <zackr@vmware.com> | 2021-12-06 20:26:09 +0300 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2021-12-09 21:16:10 +0300 |
commit | 8aadeb8ad874b3b13431fd08c1ddb6d5e0212c7f (patch) | |
tree | 4bd896d30ca6a6a60c17f1edf34e10d4ebbc84bc /drivers/gpu/drm/vmwgfx/ttm_object.h | |
parent | 21a6732f464894fa43fa1d43fdc7570b454b970c (diff) | |
download | linux-8aadeb8ad874b3b13431fd08c1ddb6d5e0212c7f.tar.xz |
drm/vmwgfx: Remove the dedicated memory accounting
vmwgfx shared very elaborate memory accounting with ttm. It was moved
from ttm to vmwgfx in change
f07069da6b4c ("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: f07069da6b4c ("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
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/ttm_object.h')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/ttm_object.h | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/gpu/drm/vmwgfx/ttm_object.h b/drivers/gpu/drm/vmwgfx/ttm_object.h index 6885ccbeec7a..a0f2da1012ba 100644 --- a/drivers/gpu/drm/vmwgfx/ttm_object.h +++ b/drivers/gpu/drm/vmwgfx/ttm_object.h @@ -42,7 +42,6 @@ #include <linux/list.h> #include <linux/rcupdate.h> -#include "ttm_memory.h" #include "vmwgfx_hashtab.h" /** @@ -296,7 +295,6 @@ extern void ttm_object_file_release(struct ttm_object_file **p_tfile); /** * ttm_object device init - initialize a struct ttm_object_device * - * @mem_glob: struct ttm_mem_global for memory accounting. * @hash_order: Order of hash table used to hash the base objects. * @ops: DMA buf ops for prime objects of this device. * @@ -305,8 +303,7 @@ extern void ttm_object_file_release(struct ttm_object_file **p_tfile); */ extern struct ttm_object_device * -ttm_object_device_init(struct ttm_mem_global *mem_glob, - unsigned int hash_order, +ttm_object_device_init(unsigned int hash_order, const struct dma_buf_ops *ops); /** @@ -352,13 +349,6 @@ extern int ttm_prime_handle_to_fd(struct ttm_object_file *tfile, #define ttm_prime_object_kfree(__obj, __prime) \ kfree_rcu(__obj, __prime.base.rhead) -/* - * Extra memory required by the base object's idr storage, which is allocated - * separately from the base object itself. We estimate an on-average 128 bytes - * per idr. - */ -#define TTM_OBJ_EXTRA_SIZE 128 - struct ttm_base_object * ttm_base_object_noref_lookup(struct ttm_object_file *tfile, uint32_t key); |