Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 552f1199 authored by Kamal Agrawal's avatar Kamal Agrawal Committed by Rohan Sethi
Browse files

msm: kgsl: Use non-atomic snapshot memory if it is unused



Over time, memory gets fragmented, and eventually, a system that is
up for a long time may have only a few physically contiguous pages.
Hence, there is a chance of atomic snapshot memory allocation failure.
Use non-atomic snapshot memory if it is unused as it is allocated
during probe time.

Change-Id: I725adeb80614a775f92213ebe9768f4f2f1c70a2
Signed-off-by: default avatarKamal Agrawal <kamaagra@codeaurora.org>
Signed-off-by: default avatarRohan Sethi <rohsethi@codeaurora.org>
parent 91a7f066
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -687,6 +687,10 @@ static void kgsl_device_snapshot_atomic(struct kgsl_device *device)
	}

	device->snapshot_memory_atomic.size = device->snapshot_memory.size;
	if (!device->snapshot_faultcount) {
		/* Use non-atomic snapshot memory if it is unused */
		device->snapshot_memory_atomic.ptr = device->snapshot_memory.ptr;
	} else {
		device->snapshot_memory_atomic.ptr = devm_kzalloc(&device->pdev->dev,
				device->snapshot_memory_atomic.size, GFP_ATOMIC);

@@ -695,6 +699,7 @@ static void kgsl_device_snapshot_atomic(struct kgsl_device *device)
				"KGSL failed to allocate memory for atomic snapshot\n");
			return;
		}
	}

	/* Allocate memory for the snapshot instance */
	snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC);