Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc/sparc report to the scheduler if we have diff...



details:   https://anonhg.NetBSD.org/src/rev/817d504140c5
branches:  trunk
changeset: 983545:817d504140c5
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat May 29 02:58:37 2021 +0000

description:
report to the scheduler if we have different speed cpus.

diffstat:

 sys/arch/sparc/sparc/cpu.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r cae5e74243ee -r 817d504140c5 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c        Fri May 28 13:55:24 2021 +0000
+++ b/sys/arch/sparc/sparc/cpu.c        Sat May 29 02:58:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.259 2021/01/24 07:36:54 mrg Exp $ */
+/*     $NetBSD: cpu.c,v 1.260 2021/05/29 02:58:37 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.259 2021/01/24 07:36:54 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.260 2021/05/29 02:58:37 mrg Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_lockdebug.h"
@@ -520,6 +520,19 @@
         */
        if (bootmid == 0)
                bootmid = mid;
+
+       /*
+        * Set speeds now we've attached all CPUs.
+        */
+       if (sparc_ncpus > 1 && sparc_ncpus == cpu_attach_count) {
+               CPU_INFO_ITERATOR n;
+               unsigned best_hz = 0;
+
+               for (CPU_INFO_FOREACH(n, cpi))
+                       best_hz = MAX(cpi->hz, best_hz);
+               for (CPU_INFO_FOREACH(n, cpi))
+                       cpu_topology_setspeed(cpi, cpi->hz < best_hz);
+       }
 }
 
 /*



Home | Main Index | Thread Index | Old Index