summaryrefslogtreecommitdiff
path: root/x11-drivers/nvidia-drivers/files/nvidia-drivers-455.45.01-reduce-kmalloc-limit.patch
blob: c61033bf2a92da4d7890bc663b81bb515b211ea8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Patch taken from
  https://forums.developer.nvidia.com/t/455-23-04-page-allocation-failure-in-kernel-module-at-random-points/155250/55
Bug: https://bugs.gentoo.org/755497
Credits go to Gregory Beauregard for pointing this out

--- a/kernel/nvidia-modeset/nvidia-modeset-linux.c
+++ b/kernel/nvidia-modeset/nvidia-modeset-linux.c
@@ -282,8 +282,8 @@
  * are called while nvkms_lock is held.
  *************************************************************************/
 
-/* Don't use kmalloc for allocations larger than 128k */
-#define KMALLOC_LIMIT (128 * 1024)
+/* Don't use kmalloc for allocations larger than one page */
+#define KMALLOC_LIMIT PAGE_SIZE
 
 void* NVKMS_API_CALL nvkms_alloc(size_t size, NvBool zero)
 {