• Zack Rusin's avatar
    drm/vmwgfx: Remove the dedicated memory accounting · 8aadeb8a
    Zack Rusin authored
    vmwgfx shared very elaborate memory accounting with ttm. It was moved
    from ttm to vmwgfx in change
    f07069da ("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: f07069da ("drm/ttm: move memory accounting into vmwgfx v4")
    Signed-off-by: default avatarZack Rusin <zackr@vmware.com>
    Reviewed-by: default avatarMartin Krastev <krastevm@vmware.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-2-zack@kde.org
    8aadeb8a
vmwgfx_cmdbuf_res.c 9.39 KB