diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-12 22:06:41 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-12 22:08:22 -0400 |
commit | 49e744c65c8e3d2f72357f865dbd1908796950cf (patch) | |
tree | 61e51cc9a793a14a31c08334a10f5281fb8b03f5 /sys/arch/amd64/amd64 | |
parent | 5db972de06d6aa805c2dd6e8b1789b659ae79fcd (diff) |
kernel: proc: Improve handling of 'nswitch'
- Extend 'nswitch' to 64-bits as it increments fast
- Ensure writes to 'nswitch' are atomic
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch/amd64/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/proc_machdep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/proc_machdep.c b/sys/arch/amd64/amd64/proc_machdep.c index ad807fe..a1d6563 100644 --- a/sys/arch/amd64/amd64/proc_machdep.c +++ b/sys/arch/amd64/amd64/proc_machdep.c @@ -256,7 +256,7 @@ sched_switch_to(struct trapframe *tf, struct proc *td) /* Update stats */ cpustat = &ci->stat; - cpustat->nswitch++; + atomic_inc_64(&cpustat->nswitch); ci->curtd = td; pcbp = &td->pcb; |