diff options
author | Christian König <christian.koenig@amd.com> | 2020-11-16 13:47:11 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2021-02-09 17:27:12 +0100 |
commit | d4bd7776a7ac504510656c0053a55c0cfd1ebc96 (patch) | |
tree | f460c3127ce0e755b6a271215e35320118aa259d /drivers/i2c | |
parent | 8a945edd183d296cd1125a2724fb0f3c77d8e9b3 (diff) |
drm/ttm: rework ttm_tt page limit v4
TTM implements a rather extensive accounting of allocated memory.
There are two reasons for this:
1. It tries to block userspace allocating a huge number of very small
BOs without accounting for the kmalloced memory.
2. Make sure we don't over allocate and run into an OOM situation
during swapout while trying to handle the memory shortage.
This is only partially a good idea. First of all it is perfectly
valid for an application to use all of system memory, limiting it to
50% is not really acceptable.
What we need to take care of is that the application is held
accountable for the memory it allocated. This is what control
mechanisms like memcg and the normal Linux page accounting already do.
Making sure that we don't run into an OOM situation while trying to
cope with a memory shortage is still a good idea, but this is also
not very well implemented since it means another opportunity of
recursion from the driver back into TTM.
So start to rework all of this by implementing a shrinker callback which
allows for TT object to be swapped out if necessary.
v2: Switch from limit to shrinker callback.
v3: fix gfp mask handling, use atomic for swapable_pages, add debugfs
v4: drop the extra gfp_mask checks
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210208133226.36955-1-christian.koenig@amd.com
Diffstat (limited to 'drivers/i2c')
0 files changed, 0 insertions, 0 deletions