summaryrefslogtreecommitdiff
path: root/sys/include/arch/amd64/cpu.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-17 17:44:05 -0400
committerIan Moffett <ian@osmora.org>2025-07-17 18:35:22 -0400
commit3c9e0969840d47a812f5e65fa43f694f2e7f3ff3 (patch)
tree107d4709904495e47436889ccb17418bdaefff93 /sys/include/arch/amd64/cpu.h
parent984b549864280696256cec135651770ff0b1251b (diff)
kernel: sched: Add support for CPU pinning
This commit introduces support for pinning processes to specific cores which can be useful for things like, keeping core-specific workthreads running on their respective processors as well as mitigating very specific cases of false-sharing and performance degradation caused by a thread jumping between cores which requires cache-line entries to be thrashed around between them. Threads pinned to a specific core will always see their cached data in the same L1, L2, etc. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/amd64/cpu.h')
-rw-r--r--sys/include/arch/amd64/cpu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/include/arch/amd64/cpu.h b/sys/include/arch/amd64/cpu.h
index a047cef..046b621 100644
--- a/sys/include/arch/amd64/cpu.h
+++ b/sys/include/arch/amd64/cpu.h
@@ -46,6 +46,7 @@
struct cpu_info {
uint32_t apicid;
uint32_t feat;
+ uint8_t id; /* MI Logical ID */
uint8_t model : 4; /* CPU model number */
uint8_t family : 4; /* CPU family ID */
uint8_t has_x2apic : 1;