History log of /netbsd-src/sys/sys/cpu.h (Results 1 – 25 of 54)
Revision Date Author Comments
# cdd498c0 17-Jan-2025 mrg <mrg@NetBSD.org>

partly prepare for more than 2-level CPU speed scheduler support

put the calls behind looking at SPCF_IDLE and SPCF_1STCLASS mostly
behind functions that can grow support for more than 2 CPU classes

partly prepare for more than 2-level CPU speed scheduler support

put the calls behind looking at SPCF_IDLE and SPCF_1STCLASS mostly
behind functions that can grow support for more than 2 CPU classes.
4 new functions, with 2 of them just simple aliases for the 1st:

bool cpu_is_type(struct cpu_info *ci, int wanted);
bool cpu_is_idle_1stclass(struct cpu_info *ci)
bool cpu_is_1stclass(struct cpu_info *ci)
bool cpu_is_better(struct cpu_info *ci1, struct cpu_info *ci2);

with this in place, we can retain the desire to run on 1st-class by
preference, while also expanding cpu_is_better() to handle multiple
non 1st-class CPUs. ultimately, i envision seeing a priority number
where we can mark the fastest turbo-speed cores ahead of others, for
the case we can detect this.

XXX: use struct schedstate_percpu instead of cpu_info?

NFCI.

show more ...


# 7dff59c8 05-Mar-2024 thorpej <thorpej@NetBSD.org>

Revert previous until I can diagnose a failure reported by gson.


# 33021732 05-Mar-2024 thorpej <thorpej@NetBSD.org>

Early in main(), assert that curcpu() evaluates as the primary CPU and
stash away a pointer to it as the boot CPU for quick reference later.


# 3271fbd4 08-Jul-2023 riastradh <riastradh@NetBSD.org>

curcpu_stable(9): New function for asserting curcpu() is stable.


# 9977fb87 15-Jun-2020 ad <ad@NetBSD.org>

Fix a comment.


# 6149350c 15-Feb-2020 skrll <skrll@NetBSD.org>

Remove the 'slow' argument from cpu_topology_set and create a new
function cpu_topology_setspeed which sets the relative speed of the
cpu.

This allows cpu_topology_set is be used at cpu hatch time.

Remove the 'slow' argument from cpu_topology_set and create a new
function cpu_topology_setspeed which sets the relative speed of the
cpu.

This allows cpu_topology_set is be used at cpu hatch time. The relative
speed is only known once all cpus have hatched/attached

OK ad@

show more ...


# 1f51cad9 09-Feb-2020 skrll <skrll@NetBSD.org>

Trailing whitespace


# c5b06097 09-Jan-2020 ad <ad@NetBSD.org>

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during pree

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).

show more ...


# 090e8e0a 21-Dec-2019 ad <ad@NetBSD.org>

Fix build break (ci->ci_dev is not available on every port).


# 8ae3ad1d 20-Dec-2019 ad <ad@NetBSD.org>

Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest num

Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.

show more ...


# 5d954ab6 02-Dec-2019 ad <ad@NetBSD.org>

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of f

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.

show more ...


# 11ba4e18 23-Nov-2019 ad <ad@NetBSD.org>

Minor scheduler cleanup:

- Adapt to cpu_need_resched() changes. Avoid lost & duplicate IPIs and ASTs.
sched_resched_cpu() and sched_resched_lwp() contain the logic for this.
- Changes for LSIDL to

Minor scheduler cleanup:

- Adapt to cpu_need_resched() changes. Avoid lost & duplicate IPIs and ASTs.
sched_resched_cpu() and sched_resched_lwp() contain the logic for this.
- Changes for LSIDL to make the locking scheme match the intended design.
- Reduce lock contention and false sharing further.
- Numerous small bugfixes, including some corrections for SCHED_FIFO/RT.
- Use setrunnable() in more places, and merge cut & pasted code.

show more ...


# 8f06c592 19-Apr-2018 christos <christos@NetBSD.org>

s/static inline/static __inline/g for consistency with other include
headers.


# bd347601 16-Dec-2017 mrg <mrg@NetBSD.org>

CPU_INFO_FOREACH() must always iterate at least the boot cpu.
document this in sys/cpu.h and fix the arm and mips versions
to check ncpu is non zero before using it as an iterator max.

this should f

CPU_INFO_FOREACH() must always iterate at least the boot cpu.
document this in sys/cpu.h and fix the arm and mips versions
to check ncpu is non zero before using it as an iterator max.

this should fix the new assert in init_main.c.

show more ...


# a6e0a15f 19-May-2014 rmind <rmind@NetBSD.org>

Constify kcpuset_countset() and cpu_index() parameters.


# 27889075 24-Mar-2014 christos <christos@NetBSD.org>

- create cpu_{g,s}etmodel() and hide cpu_model from direct access.


# d848d0ec 25-Nov-2013 christos <christos@NetBSD.org>

and the last CIRCLEQ is gone now.


# df64447c 24-Nov-2013 rmind <rmind@NetBSD.org>

Remove cpu_queue (and thus eleminate another use of CIRCLEQ) by replacing
its uses with cpu_infos array. Extra testing by christos@.


# 035939be 17-Oct-2012 drochner <drochner@NetBSD.org>

put binary compatibility support for the old AMD-only CPU microcode
update API inside COMPAT_60


# 312c3390 29-Aug-2012 drochner <drochner@NetBSD.org>

Extend the CPU microcode update framework to support Intel x86 CPUs.
Contrary to the AMD implementation, it doesn't use xcalls to distribute
the update to all CPUs but relies on cpuctl(8) to bind its

Extend the CPU microcode update framework to support Intel x86 CPUs.
Contrary to the AMD implementation, it doesn't use xcalls to distribute
the update to all CPUs but relies on cpuctl(8) to bind itself to the
right CPU -- to keep it simple and avoid possible problems with
hyperthreading.
Also, it doesn't parse the vendor supplied file to pick the right
part for the present CPU model but relies on userland to prepare
files with specific filenames. I'll commit a pkg for this in a minute
(pkgsrc/sysutils/intel-microcode).
The ioctl interface changed; compatibility is provided (should be
limited to COMPAT_NETBSD6 as soon as this is available).

show more ...


# f7666738 29-Jan-2012 rmind <rmind@NetBSD.org>

- Add mi_cpu_init() and initialise cpu_lock and kcpuset_attached/running there.
- Add kcpuset_running which gets set in idle_loop().
- Use kcpuset_running in pserialize_perform().


# a3f6c067 13-Jan-2012 cegger <cegger@NetBSD.org>

Support CPU microcode loading via cpuctl(8).
Implemented and enabled via CPU_UCODE kernel config option
for x86 and Xen Dom0.
Tested on different AMD machines with different
CPU families.

ok wiz@ fo

Support CPU microcode loading via cpuctl(8).
Implemented and enabled via CPU_UCODE kernel config option
for x86 and Xen Dom0.
Tested on different AMD machines with different
CPU families.

ok wiz@ for the manpages
ok releng@
ok core@ via releng@

show more ...


# 52b220e9 07-Aug-2011 rmind <rmind@NetBSD.org>

Add kcpuset(9) - a reworked dynamic CPU set implementation for kernel.
Suitable for use during the early boot. MD and other implementations
should be replaced with this interface.

Discussed on: tec

Add kcpuset(9) - a reworked dynamic CPU set implementation for kernel.
Suitable for use during the early boot. MD and other implementations
should be replaced with this interface.

Discussed on: tech-kern@

show more ...


# 184544d1 20-Dec-2010 christos <christos@NetBSD.org>

Add a little #ifdef _KERNEL so that vmstat can use this file. Also userland
does not know about lwp_t, so use struct lwp.


# efc854cf 13-Jan-2010 mrg <mrg@NetBSD.org>

introduce a new function that returns a unique string for each cpu:

char *cpu_name(struct cpu_info *);

and use it when setting up the runq event counters, avoiding an 8 byte
kmem(4) allocation for

introduce a new function that returns a unique string for each cpu:

char *cpu_name(struct cpu_info *);

and use it when setting up the runq event counters, avoiding an 8 byte
kmem(4) allocation for each cpu. there are more places the cpuname is
used that can be converted to using this new interface, but that can
and will be done as future work.

as discussed with rmind.

show more ...


123