]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/nouveau/hmm: fix nouveau_dmem_chunk allocations
authorRalph Campbell <rcampbell@nvidia.com>
Tue, 21 Apr 2020 23:11:07 +0000 (16:11 -0700)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 22 May 2020 01:13:52 +0000 (11:13 +1000)
commitb44a5e83b6e31e57b40c08f2562af9013c7e64e6
treecff2ddf173d379166584548bc70d898d6fa0217d
parentfc262644b783eed9e8456557a5407603f0f92b98
drm/nouveau/nouveau/hmm: fix nouveau_dmem_chunk allocations

In nouveau_dmem_init(), a number of struct nouveau_dmem_chunk are allocated
and put on the dmem->chunk_empty list. Then in nouveau_dmem_pages_alloc(),
a nouveau_dmem_chunk is removed from the list and GPU memory is allocated.
However, the nouveau_dmem_chunk is never removed from the chunk_empty
list nor placed on the chunk_free or chunk_full lists. This results
in only one chunk ever being actually used (2MB) and quickly leads to
migration to device private memory failures.

Fix this by having just one list of free device private pages and if no
pages are free, allocate a chunk of device private pages and GPU memory.

Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_dmem.c