mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
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: Kamal Agrawal <kamaagra@codeaurora.org> Signed-off-by: Rohan Sethi <rohsethi@codeaurora.org>
This commit is contained in:
parent
91a7f066e1
commit
552f119915
1 changed files with 11 additions and 6 deletions
|
|
@ -687,13 +687,18 @@ static void kgsl_device_snapshot_atomic(struct kgsl_device *device)
|
|||
}
|
||||
|
||||
device->snapshot_memory_atomic.size = device->snapshot_memory.size;
|
||||
device->snapshot_memory_atomic.ptr = devm_kzalloc(&device->pdev->dev,
|
||||
device->snapshot_memory_atomic.size, GFP_ATOMIC);
|
||||
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);
|
||||
|
||||
if (!device->snapshot_memory_atomic.ptr) {
|
||||
dev_err(device->dev,
|
||||
"KGSL failed to allocate memory for atomic snapshot\n");
|
||||
return;
|
||||
if (!device->snapshot_memory_atomic.ptr) {
|
||||
dev_err(device->dev,
|
||||
"KGSL failed to allocate memory for atomic snapshot\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate memory for the snapshot instance */
|
||||
|
|
|
|||
Loading…
Reference in a new issue