diff options
author | Dave Airlie <airlied@redhat.com> | 2025-09-04 12:16:41 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2025-09-11 10:04:55 +1000 |
commit | 3629e1b22e5ba2475fe2531e59c9446c4979e2f9 (patch) | |
tree | b5951cd8083963e473dc42d5bbbf8935e6fc0f41 /rust/helpers/helpers.c | |
parent | 619ddf57cfddf81ffb75905cc5f533e61206b10c (diff) |
nouveau: populate buffers before exporting them.
Before exporting a buffer, make sure it has been populated with
pages at least once.
While discussing cgroups we noticed a problem where you could export
a BO to a dma-buf without having it ever being backed or accounted for.
This meant in low memory situations or eventually with cgroups, a
lower privledged process might cause the compositor to try and allocate
a lot of memory on it's behalf and this could fail. At least make
sure the exporter has managed to allocate the RAM at least once
before exporting the object.
This only applies currently to TTM_PL_SYSTEM objects, because
GTT objects get populated on first validate, and VRAM doesn't
use TT.
Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://lore.kernel.org/r/20250904021643.2050497-3-airlied@gmail.com
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions