llvm-project/llvm/lib
stk 9902a0945d Add ThreadPriority::Low, and use QoS class Utility on Mac
On Apple Silicon Macs, using a Darwin thread priority of PRIO_DARWIN_BG seems to
map directly to the QoS class Background. With this priority, the thread is
confined to efficiency cores only, which makes background indexing take forever.

Introduce a new ThreadPriority "Low" that sits in the middle between Background
and Default, and maps to QoS class "Utility" on Mac. Make this new priority the
default for indexing. This makes the thread run on all cores, but still lowers
priority enough to keep the machine responsive, and not interfere with
user-initiated actions.

I didn't change the implementations for Windows and Linux; on these systems,
both ThreadPriority::Background and ThreadPriority::Low map to the same thread
priority. This could be changed as a followup (e.g. by using SCHED_BATCH for Low
on Linux).

See also https://github.com/clangd/clangd/issues/1119.

Reviewed By: sammccall, dgoldman

Differential Revision: https://reviews.llvm.org/D124715
2022-05-16 10:01:49 +02:00
..
Analysis ScalarEvolution.cpp: Reformat. 2022-05-15 20:51:27 +09:00
AsmParser
BinaryFormat
Bitcode
Bitstream
CodeGen [TargetLowering] expandCTPOP don't create an used constant mask for i8 ctpop. NFC 2022-05-14 20:35:38 -07:00
DWARFLinker [DWARFLinker][NFC] cleanup AddressManager interface. 2022-05-15 22:47:04 +03:00
DWP
DebugInfo
Debuginfod
Demangle
ExecutionEngine
Extensions
FileCheck
Frontend
FuzzMutate
Fuzzer
IR
IRReader
InterfaceStub
LTO
LineEditor
Linker
MC
MCA
ObjCopy
Object
ObjectYAML
Option
Passes
ProfileData
Remarks
Support Add ThreadPriority::Low, and use QoS class Utility on Mac 2022-05-16 10:01:49 +02:00
TableGen
Target [Mips] Implement hasDivRemOp() 2022-05-16 14:45:40 +08:00
Testing
TextAPI
ToolDrivers
Transforms [LV] Set SCEVCheckCond to nullptr whenever it was used. 2022-05-15 21:52:07 +01:00
WindowsDriver
WindowsManifest
XRay
CMakeLists.txt