diff --git a/fs_mgr/libsnapshot/snapuserd/user-space-merge/merge_worker.cpp b/fs_mgr/libsnapshot/snapuserd/user-space-merge/merge_worker.cpp index bd7eaca74..0f4674ced 100644 --- a/fs_mgr/libsnapshot/snapuserd/user-space-merge/merge_worker.cpp +++ b/fs_mgr/libsnapshot/snapuserd/user-space-merge/merge_worker.cpp @@ -577,8 +577,10 @@ bool MergeWorker::Run() { SNAP_LOG(ERROR) << "Merge terminated early..."; return true; } + auto merge_thread_priority = android::base::GetUintProperty( + "ro.virtual_ab.merge_thread_priority", ANDROID_PRIORITY_BACKGROUND); - if (!SetThreadPriority(ANDROID_PRIORITY_BACKGROUND)) { + if (!SetThreadPriority(merge_thread_priority)) { SNAP_PLOG(ERROR) << "Failed to set thread priority"; } diff --git a/fs_mgr/libsnapshot/snapuserd/user-space-merge/read_worker.cpp b/fs_mgr/libsnapshot/snapuserd/user-space-merge/read_worker.cpp index d40b6d11d..35a162199 100644 --- a/fs_mgr/libsnapshot/snapuserd/user-space-merge/read_worker.cpp +++ b/fs_mgr/libsnapshot/snapuserd/user-space-merge/read_worker.cpp @@ -17,8 +17,10 @@ #include #include +#include "android-base/properties.h" #include "read_worker.h" #include "snapuserd_core.h" +#include "user-space-merge/worker.h" #include "utility.h" namespace android { @@ -259,8 +261,10 @@ bool ReadWorker::Run() { SNAP_LOG(INFO) << "Processing snapshot I/O requests...."; pthread_setname_np(pthread_self(), "ReadWorker"); + auto worker_thread_priority = android::base::GetUintProperty( + "ro.virtual_ab.worker_thread_priority", ANDROID_PRIORITY_NORMAL); - if (!SetThreadPriority(ANDROID_PRIORITY_NORMAL)) { + if (!SetThreadPriority(worker_thread_priority)) { SNAP_PLOG(ERROR) << "Failed to set thread priority"; }