]> git.baikalelectronics.ru Git - kernel.git/commit
drm/mm: Break long searches in fragmented address spaces
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 7 Feb 2020 15:17:20 +0000 (15:17 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 6 Mar 2020 11:15:43 +0000 (11:15 +0000)
commit644cac6d1b898970c0cf84bb05fa4e335cc673b9
tree888cd145981b956c03c0633acde26a658c8cbc51
parentf8dbe841336e454d27d1d90ee71b6679fcb19d66
drm/mm: Break long searches in fragmented address spaces

We try hard to select a suitable hole in the drm_mm first time. But if
that is unsuccessful, we then have to look at neighbouring nodes, and
this requires traversing the rbtree. Walking the rbtree can be slow
(much slower than a linear list for deep trees), and if the drm_mm has
been purposefully fragmented our search can be trapped for a long, long
time. For non-preemptible kernels, we need to break up long CPU bound
sections by manually checking for cond_resched(); similarly we should
also bail out if we have been told to terminate. (In an ideal world, we
would break for any signal, but we need to trade off having to perform
the search again after ERESTARTSYS, which again may form a trap of
making no forward progress.)

Reported-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200207151720.2812125-1-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_mm.c