Actions
Bug #14594
closedpsrinfo(1M) may fail to emit socket type
Start date:
2022-03-27
Due date:
% Done:
100%
Estimated time:
0.10 h
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:
Description
With SMT-enabled processors, psrinfo -pv does not emit the CPU's socket type even if it is known to the kernel:
root@teapot:~# psrinfo -pv The physical processor has 28 cores and 56 virtual processors (0-55) The core has 2 virtual processors (0-1) The core has 2 virtual processors (2-3) The core has 2 virtual processors (4-5) The core has 2 virtual processors (6-7) The core has 2 virtual processors (8-9) The core has 2 virtual processors (10-11) The core has 2 virtual processors (12-13) The core has 2 virtual processors (14-15) The core has 2 virtual processors (16-17) The core has 2 virtual processors (18-19) The core has 2 virtual processors (20-21) The core has 2 virtual processors (22-23) The core has 2 virtual processors (24-25) The core has 2 virtual processors (26-27) The core has 2 virtual processors (28-29) The core has 2 virtual processors (30-31) The core has 2 virtual processors (32-33) The core has 2 virtual processors (34-35) The core has 2 virtual processors (36-37) The core has 2 virtual processors (38-39) The core has 2 virtual processors (40-41) The core has 2 virtual processors (42-43) The core has 2 virtual processors (44-45) The core has 2 virtual processors (46-47) The core has 2 virtual processors (48-49) The core has 2 virtual processors (50-51) The core has 2 virtual processors (52-53) The core has 2 virtual processors (54-55) x86 (AuthenticAMD A00F11 family 25 model 1 step 1 clock 2750 MHz) AMD EPYC 7453 28-Core Processor The physical processor has 28 cores and 56 virtual processors (56-111) The core has 2 virtual processors (56-57) The core has 2 virtual processors (58-59) The core has 2 virtual processors (60-61) The core has 2 virtual processors (62-63) The core has 2 virtual processors (64-65) The core has 2 virtual processors (66-67) The core has 2 virtual processors (68-69) The core has 2 virtual processors (70-71) The core has 2 virtual processors (72-73) The core has 2 virtual processors (74-75) The core has 2 virtual processors (76-77) The core has 2 virtual processors (78-79) The core has 2 virtual processors (80-81) The core has 2 virtual processors (82-83) The core has 2 virtual processors (84-85) The core has 2 virtual processors (86-87) The core has 2 virtual processors (88-89) The core has 2 virtual processors (90-91) The core has 2 virtual processors (92-93) The core has 2 virtual processors (94-95) The core has 2 virtual processors (96-97) The core has 2 virtual processors (98-99) The core has 2 virtual processors (100-101) The core has 2 virtual processors (102-103) The core has 2 virtual processors (104-105) The core has 2 virtual processors (106-107) The core has 2 virtual processors (108-109) The core has 2 virtual processors (110-111) x86 (AuthenticAMD A00F11 family 25 model 1 step 1 clock 2750 MHz) AMD EPYC 7453 28-Core Processor > fffffeb320006000::print cpu_t cpu_m.mcpu_cpi | ::print struct cpuid_info { cpi_pass = 0x4 cpi_maxeax = 0x10 cpi_vendorstr = [ "AuthenticAMD" ] cpi_vendor = 0x2 cpi_family = 0x19 cpi_model = 0x1 cpi_step = 0x1 ... cpi_coreid = 0xd cpi_pkgcoreid = 0xd cpi_ncore_per_chip = 0x1c cpi_ncore_bits = 0x6 cpi_nthread_bits = 0x2 cpi_support = [ 0x178bf1ff, 0x2fd3f9ff, 0, 0x7efa320b, 0x75c237ff, 0x219c9db9 ] cpi_chiprev = 0x2190002 cpi_chiprevstr = 0xfffffffffbd90725 "GN-B1" cpi_socket = 0x200001f cpi_mwait = { mon_min = 0x40 mon_max = 0x40 size_actual = 0x40 buf_actual = 0xfffffeb319734680 support = 0x7 } cpi_apicid = 0x1a cpi_procnodeid = 0 cpi_procnodes_per_pkg = 0x1 cpi_compunitid = 0xd cpi_cores_per_compunit = 0x1 ... >
This is a trivial logic bug in user software, probably just an omission.
Updated by Thirteen Oxide over 1 year ago
diff --git a/usr/src/cmd/psrinfo/psrinfo.c b/usr/src/cmd/psrinfo/psrinfo.c index 19c4ef41ba..69b89f10b7 100644 --- a/usr/src/cmd/psrinfo/psrinfo.c +++ b/usr/src/cmd/psrinfo/psrinfo.c @@ -13,6 +13,7 @@ * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright 2019 Joyent, Inc. + * Copyright 2022 Oxide Computer Co. */ /* @@ -285,10 +286,6 @@ print_vp(int nspec) if (((len = strlen(vcpu->v_brand)) != 0) && (strncmp(vcpu->v_brand, vcpu->v_impl, len) != 0)) (void) printf("\t%s", vcpu->v_brand); - if (strcmp(vcpu->v_socket, "Unknown") != 0) - (void) printf("\t[ %s: %s ]", _("Socket"), - vcpu->v_socket); - (void) putchar('\n'); } else { for (l2 = chip->p_cores; l2; l2 = l2->l_next) { core = l2->l_ptr; @@ -305,8 +302,13 @@ print_vp(int nspec) } if (((len = strlen(vcpu->v_brand)) != 0) && (strncmp(vcpu->v_brand, vcpu->v_impl, len) != 0)) - (void) printf(" %s\n", vcpu->v_brand); + (void) printf(" %s", vcpu->v_brand); } + if (strcmp(vcpu->v_socket, "Unknown") != 0) { + (void) printf("\t[ %s: %s ]", _("Socket"), + vcpu->v_socket); + } + (void) putchar('\n'); } }
Updated by Thirteen Oxide over 1 year ago
With this change, the same machine reports:
root@teapot:~# psrinfo -pv The physical processor has 28 cores and 56 virtual processors (0-55) The core has 2 virtual processors (0-1) The core has 2 virtual processors (2-3) The core has 2 virtual processors (4-5) The core has 2 virtual processors (6-7) The core has 2 virtual processors (8-9) The core has 2 virtual processors (10-11) The core has 2 virtual processors (12-13) The core has 2 virtual processors (14-15) The core has 2 virtual processors (16-17) The core has 2 virtual processors (18-19) The core has 2 virtual processors (20-21) The core has 2 virtual processors (22-23) The core has 2 virtual processors (24-25) The core has 2 virtual processors (26-27) The core has 2 virtual processors (28-29) The core has 2 virtual processors (30-31) The core has 2 virtual processors (32-33) The core has 2 virtual processors (34-35) The core has 2 virtual processors (36-37) The core has 2 virtual processors (38-39) The core has 2 virtual processors (40-41) The core has 2 virtual processors (42-43) The core has 2 virtual processors (44-45) The core has 2 virtual processors (46-47) The core has 2 virtual processors (48-49) The core has 2 virtual processors (50-51) The core has 2 virtual processors (52-53) The core has 2 virtual processors (54-55) x86 (AuthenticAMD A00F11 family 25 model 1 step 1 clock 2750 MHz) AMD EPYC 7453 28-Core Processor [ Socket: SP3 ] The physical processor has 28 cores and 56 virtual processors (56-111) The core has 2 virtual processors (56-57) The core has 2 virtual processors (58-59) The core has 2 virtual processors (60-61) The core has 2 virtual processors (62-63) The core has 2 virtual processors (64-65) The core has 2 virtual processors (66-67) The core has 2 virtual processors (68-69) The core has 2 virtual processors (70-71) The core has 2 virtual processors (72-73) The core has 2 virtual processors (74-75) The core has 2 virtual processors (76-77) The core has 2 virtual processors (78-79) The core has 2 virtual processors (80-81) The core has 2 virtual processors (82-83) The core has 2 virtual processors (84-85) The core has 2 virtual processors (86-87) The core has 2 virtual processors (88-89) The core has 2 virtual processors (90-91) The core has 2 virtual processors (92-93) The core has 2 virtual processors (94-95) The core has 2 virtual processors (96-97) The core has 2 virtual processors (98-99) The core has 2 virtual processors (100-101) The core has 2 virtual processors (102-103) The core has 2 virtual processors (104-105) The core has 2 virtual processors (106-107) The core has 2 virtual processors (108-109) The core has 2 virtual processors (110-111) x86 (AuthenticAMD A00F11 family 25 model 1 step 1 clock 2750 MHz) AMD EPYC 7453 28-Core Processor [ Socket: SP3 ]
Updated by Robert Mustacchi about 1 year ago
I also confirmed it correctly still prints the socket on a 1P system:
$ pfexec ./cmd/psrinfo/psrinfo -vp The physical processor has 24 cores and 48 virtual processors (0-47) The core has 2 virtual processors (0 24) The core has 2 virtual processors (1 25) The core has 2 virtual processors (2 26) The core has 2 virtual processors (3 27) The core has 2 virtual processors (4 28) The core has 2 virtual processors (5 29) The core has 2 virtual processors (6 30) The core has 2 virtual processors (7 31) The core has 2 virtual processors (8 32) The core has 2 virtual processors (9 33) The core has 2 virtual processors (10 34) The core has 2 virtual processors (11 35) The core has 2 virtual processors (12 36) The core has 2 virtual processors (13 37) The core has 2 virtual processors (14 38) The core has 2 virtual processors (15 39) The core has 2 virtual processors (16 40) The core has 2 virtual processors (17 41) The core has 2 virtual processors (18 42) The core has 2 virtual processors (19 43) The core has 2 virtual processors (20 44) The core has 2 virtual processors (21 45) The core has 2 virtual processors (22 46) The core has 2 virtual processors (23 47) x86 (AuthenticAMD A00F11 family 25 model 1 step 1 clock 2650 MHz) AMD EPYC 7413 24-Core Processor [ Socket: SP3 ]
Updated by Electric Monk about 1 year ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit db6ea8e69c35f1dac85a7e12505787c1212108b2
commit db6ea8e69c35f1dac85a7e12505787c1212108b2 Author: Keith M Wesolowski <wesolows@oxide.computer> Date: 2022-07-11T23:22:17.000Z 14594 psrinfo(1M) may fail to emit socket type Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Actions