Commit Graph

22 Commits

Author SHA1 Message Date
thorpej 7dff59c837 Revert previous until I can diagnose a failure reported by gson. 2024-03-05 20:59:41 +00:00
thorpej 3302173255 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.
2024-03-05 14:39:29 +00:00
mlelstv 5238b8a351 dump topology information with aprint_debug instead of requiring to build
a DEBUG kernel.
2024-01-04 11:18:19 +00:00
riastradh 3271fbd4fa curcpu_stable(9): New function for asserting curcpu() is stable. 2023-07-08 13:59:05 +00:00
andvar 34df0b3791 remove double "with" in comments and usage text. Also fix one typo. 2022-01-24 09:42:13 +00:00
andvar 50d9072672 remove duplicate the article in comments. 2021-10-04 21:02:39 +00:00
simonb 7acb61f4ce Don't dump the CPU topology in the uninspiring case of a single CPU. 2020-09-23 12:05:16 +00:00
ad ba90a6ba38 Counter tweaks:
- Don't need to count anonpages+filepages any more; clean+unknown+dirty for
  each kind of page can be summed to get the totals.

- Track the number of free pages with a counter so that it's one less thing
  for the allocator to do, which opens up further options there.

- Remove cpu_count_sync_one().  It has no users and doesn't save a whole lot.
  For the cheap option, give cpu_count_sync() a boolean parameter indicating
  that a cached value is okay, and rate limit the updates for cached values
  to hz.
2020-06-11 22:21:05 +00:00
ad 7d77d42694 Don't overwrite ci_is_slow if it has explicitly been set. Changed for
correctness, should have no impact.
2020-03-26 19:23:18 +00:00
skrll 6149350c48 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@
2020-02-15 07:20:40 +00:00
skrll 1f51cad9fa Trailing whitespace 2020-02-09 09:29:50 +00:00
ad d2f8c8b222 Fix some more bugs in the topo stuff, that prevented it from working
properly with fake topo info + MP.
2020-01-13 20:30:08 +00:00
mrg 600b17eccb more diag for cpu topology debug kernels:
- print the slow/fast status of each cpu
- if cpu topology is bogus, print info about the two CPUs that
  appear to have the same info.
2020-01-13 02:18:13 +00:00
ad aeb90ec860 Fix a loltastic typo. 2020-01-13 00:20:26 +00:00
ad 6f4ef5e033 cpu topology:
- Fix a stupid bug where it complained about non-existent SMT on assymetric
  systems.

- Give each CPU a pointer back to the first CPU in same package.
2020-01-12 13:29:24 +00:00
mrg b0829efdba provide some semblance of valid cpu topology for big.little systems.
while attaching cpus, if the FDT provides "capacity-dmips-mhz" track
the fastest set, and call cpu_topology_set() with slow=true for any
cpus that are not the fastest.

bug fix for cpu_topology_set(): actually set ci_is_slow for slow cpus.

with this change, and -current's recent scheduler changes, this means
that long running processes run on the faster cores.  on RK3399 based
systems, i am seeing 20-50% speed ups for many tasks.


XXX: all this can be made common with armv7 big.little.
2020-01-12 09:29:18 +00:00
ad c5b060977a - 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).
2020-01-09 16:35:03 +00:00
ad 5090a56b8e mi_cpu_init(): provide fake topology info for early boot. 2020-01-05 20:27:43 +00:00
ad 869ac77939 mi_cpu_init: set ci_smt_primary early. 2020-01-02 01:31:17 +00:00
ad 090e8e0a95 Fix build break (ci->ci_dev is not available on every port). 2019-12-21 12:53:53 +00:00
ad d65c57aa21 Fix build failure. 2019-12-21 11:35:25 +00:00
ad dd632e5898 Split subr_cpu.c out of kern_cpu.c, to contain routines shared with rump. 2019-12-20 21:20:09 +00:00