Merge "Revert "libsnapshot: set thread priority"" into main am: 35bd4d8f30 am: 283b2037ce

Original change: https://android-review.googlesource.com/c/platform/system/core/+/3128361

Change-Id: Ibae24a7574c0d77194596128ab053c5000c4ad11
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Akilesh Kailash 2024-06-12 20:33:58 +00:00 committed by Automerger Merge Worker
commit 6d45f1404e
2 changed files with 2 additions and 8 deletions

View file

@ -577,10 +577,8 @@ bool MergeWorker::Run() {
SNAP_LOG(ERROR) << "Merge terminated early...";
return true;
}
auto merge_thread_priority = android::base::GetUintProperty<uint>(
"ro.virtual_ab.merge_thread_priority", ANDROID_PRIORITY_BACKGROUND);
if (!SetThreadPriority(merge_thread_priority)) {
if (!SetThreadPriority(ANDROID_PRIORITY_BACKGROUND)) {
SNAP_PLOG(ERROR) << "Failed to set thread priority";
}

View file

@ -17,10 +17,8 @@
#include <libsnapshot/cow_format.h>
#include <pthread.h>
#include "android-base/properties.h"
#include "read_worker.h"
#include "snapuserd_core.h"
#include "user-space-merge/worker.h"
#include "utility.h"
namespace android {
@ -261,10 +259,8 @@ bool ReadWorker::Run() {
SNAP_LOG(INFO) << "Processing snapshot I/O requests....";
pthread_setname_np(pthread_self(), "ReadWorker");
auto worker_thread_priority = android::base::GetUintProperty<uint>(
"ro.virtual_ab.worker_thread_priority", ANDROID_PRIORITY_NORMAL);
if (!SetThreadPriority(worker_thread_priority)) {
if (!SetThreadPriority(ANDROID_PRIORITY_NORMAL)) {
SNAP_PLOG(ERROR) << "Failed to set thread priority";
}