Commit 9e86916f authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

[platform] Adjust scheduling params on some kernels

R=jarin@chromium.org

Change-Id: I47b506599ae338e8323ef0def63db3b2004ac798
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1594562Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61242}
parent 08de08ed
......@@ -127,5 +127,7 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
void OS::SignalCodeMovingGC() {}
void OS::AdjustSchedulingParams() {}
} // namespace base
} // namespace v8
......@@ -268,5 +268,7 @@ void OS::SignalCodeMovingGC() {
// Nothing to do on Cygwin.
}
void OS::AdjustSchedulingParams() {}
} // namespace base
} // namespace v8
......@@ -86,5 +86,7 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
void OS::SignalCodeMovingGC() {}
void OS::AdjustSchedulingParams() {}
} // namespace base
} // namespace v8
......@@ -163,5 +163,7 @@ int OS::GetUserTime(uint32_t* secs, uint32_t* usecs) {
return 0;
}
void OS::AdjustSchedulingParams() {}
} // namespace base
} // namespace v8
......@@ -172,5 +172,7 @@ void OS::SignalCodeMovingGC() {
fclose(f);
}
void OS::AdjustSchedulingParams() {}
} // namespace base
} // namespace v8
......@@ -73,5 +73,25 @@ TimezoneCache* OS::CreateTimezoneCache() {
return new PosixDefaultTimezoneCache();
}
void OS::AdjustSchedulingParams() {
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32
{
// Check availability of scheduling params.
uint32_t val = 0;
size_t valSize = sizeof(val);
int rc = sysctlbyname("kern.tcsm_available", &val, &valSize, NULL, 0);
if (rc < 0 || !val) return;
}
{
// Adjust scheduling params.
uint32_t val = 1;
int rc = sysctlbyname("kern.tcsm_enable", NULL, NULL, &val, sizeof(val));
DCHECK_GE(rc, 0);
USE(rc);
}
#endif
}
} // namespace base
} // namespace v8
......@@ -120,5 +120,7 @@ void OS::SignalCodeMovingGC() {
fclose(f);
}
void OS::AdjustSchedulingParams() {}
} // namespace base
} // namespace v8
......@@ -146,5 +146,7 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
void OS::SignalCodeMovingGC() {}
void OS::AdjustSchedulingParams() {}
} // namespace base
} // namespace v8
......@@ -63,5 +63,7 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
void OS::SignalCodeMovingGC() {}
void OS::AdjustSchedulingParams() {}
} // namespace base
} // namespace v8
......@@ -1392,5 +1392,7 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
DCHECK(result);
}
void OS::AdjustSchedulingParams() {}
} // namespace base
} // namespace v8
......@@ -248,6 +248,8 @@ class V8_BASE_EXPORT OS {
static int GetCurrentThreadId();
static void AdjustSchedulingParams();
static void ExitProcess(int exit_code);
private:
......
......@@ -319,6 +319,7 @@ Isolate::PerIsolateThreadData*
base::MutexGuard lock_guard(&thread_data_table_mutex_);
per_thread = thread_data_table_.Lookup(thread_id);
if (per_thread == nullptr) {
base::OS::AdjustSchedulingParams();
per_thread = new PerIsolateThreadData(this, thread_id);
thread_data_table_.Insert(per_thread);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment