[RAMEN9610-12171] ion: remove recursive lock
authorhyesoo.yu <hyesoo.yu@samsung.com>
Wed, 17 Oct 2018 01:24:25 +0000 (10:24 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:16 +0000 (20:23 +0300)
commit4d7e8d79a99c153b39f40c0fd25961fbf2c12692
treebf6308cce0f541c4ee92fd841fcaf8f0ef519eac
parent36077d7a3c3ddc6a96770543fa8917854fc55df6
[RAMEN9610-12171] ion: remove recursive lock

The oom notifiers is called from alloc_pages when the
memory exhausts. If the ion tries to memory allocation
with acquiring lock, and it happens out-of-memory, and
oom notifiers tries to the same lock, it makes recursive
lock.

Currently, ion_device->buffer_lock, ion_device->lock and
ion_heap->free_lock does not try to allocate memory but
buffer->lock tries to allocate memory, so we remove that
on oom notifier.

If that lock is removed, buffer->iovas and buffer->vaddr,
buffer->kmap_cnt can't be accessed because that requires
the lock to access without any synchronization problem.

Change-Id: Ie85038640d4bd271b28c993017fac865843ed83d
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
drivers/staging/android/ion/ion_debug.c