summaryrefslogtreecommitdiffstats
path: root/packages.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages.py')
-rw-r--r--packages.py49
1 files changed, 12 insertions, 37 deletions
diff --git a/packages.py b/packages.py
index 295d1ea1f..0721d65be 100644
--- a/packages.py
+++ b/packages.py
@@ -645,43 +645,18 @@ def doPreInstall(method, id, intf, instPath, dir):
if not upgrade:
foundkernel = 0
- # XXX this should probably be table driven or something...
- ncpus = isys.smpAvailable() or 1
- nthreads = isys.htavailable() or 1
- ncores = isys.coresavailable()
-
- # some examples:
- # 1x1 (nothing fancy UP): should get 1
- # ncpus = 1
- # nthreads = 1
- # ncores = 1
- # nthreads / ncores * ncpus = 1
- #
- # 2x1x2 (2 cpu -DC +HT): should get 4
- # ncpus = 2
- # nthreads = 2
- # ncores = 1
- # nthreads / ncores * ncpus = 4
- #
- # 1x2x1 (1 cpu +DC -HT): should get 2
- # ncpus = 2
- # nthreads = 2
- # ncores = 2
- # nthreads / ncores * ncpus = 2
- #
- # 1x2x2 (1 cpu +DC +HT): should get 4
- # ncpus = 2
- # nthreads = 4
- # ncores = 2
- # nthreads / ncores * ncpus = 4
- #
- # 2x2x2 (2 cpus, +DC +HT): should get 8
- # ncpus = 4
- # nthreads = 4
- # ncores = 2
- # nthreads / ncores * ncpus = 8
- #
- nthreads = (nthreads / ncores) * ncpus
+ nthreads = isys.acpicpus()
+
+ if acpicpus == 0:
+ # XXX this should probably be table driven or something...
+ ncpus = isys.smpAvailable() or 1
+ nthreads = isys.htavailable() or 1
+ ncores = isys.coresavailable()
+
+ if ncpus == 1: # machines that have one socket
+ nthreads = nthreads;
+ else: # machines with more than one socket
+ nthreads = (nthreads / ncores) * ncpus
largesmp_min = -1
if iutil.getArch() == "x86_64":