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

Commit 2e619e91 authored by Sandeep Dhavale's avatar Sandeep Dhavale Committed by Android Build Coastguard Worker
Browse files

snapuserd: remove redundant buffer lock in MergeWorker



The `buffer_lock_` is already acquired by the read-ahead thread
before the merge worker is signaled to begin. And they don't
step on read_ahead_buffer_ together due to explicit signaling with
NotifyRAForMergeReady() and WaitForMergeReady().

This means explicit locking and unlocking within `MergeOrderedOps`
and `MergeOrderedOpsAsync` is therefore unnecessary.

This change removes the redundant lock acquisition and release to
simplify the code and reduce lock contention with ReadWorkers
who may use the `buffer_lock_` to satisfy read request if it
happened to be at the same blocks which are being merged.

Additionally, the read-ahead thread priority is elevated to
`ANDROID_PRIORITY_NORMAL` to align with the readworkers thread's
priority, reducing the risk of priority inversion.

Bug: 449870677

Test: th, manual OTA

Signed-off-by: default avatarSandeep Dhavale <dhavale@google.com>
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:47c9fc9d84362c2a142d3cdc71d25a6e69f2c004
Merged-In: Ie901eac9b1fbefe1c6b57572047cd1304c618ef8
Change-Id: Ie901eac9b1fbefe1c6b57572047cd1304c618ef8
parent cec6e3cb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment