HomeFreeBSD

generic_stop_cpus: prevent parallel execution

Description

generic_stop_cpus: prevent parallel execution

This is based on the same approach as used in panic().
In theory parallel execution of generic_stop_cpus() could lead to two CPUs
stopping each other and everyone else, and thus a total system halt.
Also, in theory, we should have some smarter locking here, because two
(or more CPUs) could be stopping unrelated sets of CPUs.
But in practice, it seems, this function is only used to stop
"all other" CPUs.

Additionally, I took this opportunity to make amd64-specific suspend_cpus()
function use generic_stop_cpus() instead of rolling out essentially
duplicate code.

This code is based on code by Sandvine Incorporated.

Suggested by: mdf
Reviewed by: jhb, jkim (earlier version)
MFC after: 2 weeks

Details

Provenance
avgAuthored on Oct 12 2010, 5:40 PM
Parents
rGe07b64c56725: tmpfs + sendfile: do not produce partially valid pages for vnode's tail
Branches
Unknown
Tags
Unknown

Event Timeline