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:Sandeep Dhavale <dhavale@google.com> Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:47c9fc9d84362c2a142d3cdc71d25a6e69f2c004 Merged-In: Ie901eac9b1fbefe1c6b57572047cd1304c618ef8 Change-Id: Ie901eac9b1fbefe1c6b57572047cd1304c618ef8
Loading
Please register or sign in to comment