Commit 060e38dc authored by Martin Liu's avatar Martin Liu Committed by Treehugger Robot
Browse files

ANDROID: dma-buf: heaps: replace mutex lock with spinlock



We should use spinlock to protect page pool's critical section as
1. The critical section is short, using spinlock is more efficient.
2. Spinlock could protect priority inversion. Ex. Low priority
   thread (dmabuf-deferred) hold the page lock but get scheduled
   out under heavy loading. Then the other high priority threads
   need to wait for dmabuf-deferred to release the lock. It causes
   long allocation latency and possible UI jank.

Also, we could move NR_KERNEL_MISC_RECLAIMABLE stat out of the
critical section to make it shorter as mod_node_page_state can
handle concurrent access cases.

Bug: 245454030
Change-Id: I15f349f9e893621f71ca79f1de037de184c33edf
Signed-off-by: default avatarMartin Liu <liumartin@google.com>
parent a229a30d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment