On 2020/11/29 15:00, Ashton Fagg wrote: > Stuart Henderson <s...@spacehopper.org> writes: > > > On 2020/11/07 23:24, Ashton Fagg wrote (on bugs@): > >> > >> I'm running a Ryzen 4750U (8 cores, 16 with SMT). Obviously SMT > >> being disabled means only 8 of them show up in htop and the > >> like. However, I've noticed that 4 of my cores are always > >> idle. They never, ever leave 0% usage no matter what I do - > >> running stress tests, running make with -j8, doesn't matter, > >> only 4 cores ever have usage >0. > > > > Does this help? > > Hi Stuart, > > Apologies for the belated reply. > > I just tested this on my Ryzen machine and can confirm that it does fix > the issue with only half of the active cores being shown - screenshots > attached. Tested with `stress -c 8` as in my original report.
Thanks. I've just committed that. Here's a diff on top to update to 3.0.2. Shouldn't be much in the way of visible change but it gets rid of the Python build dependency. Index: Makefile =================================================================== RCS file: /cvs/ports/sysutils/htop/Makefile,v retrieving revision 1.24 diff -u -p -r1.24 Makefile --- Makefile 29 Nov 2020 20:15:05 -0000 1.24 +++ Makefile 29 Nov 2020 20:19:53 -0000 @@ -4,8 +4,7 @@ COMMENT = interactive process viewer GH_ACCOUNT = htop-dev GH_PROJECT = htop -GH_TAGNAME = 3.0.1 -REVISION = 0 +GH_TAGNAME = 3.0.2 CATEGORIES = sysutils @@ -18,7 +17,6 @@ PERMIT_PACKAGE = Yes WANTLIB = c curses kvm m -MODULES = lang/python RUN_DEPENDS = devel/desktop-file-utils NO_TEST = Yes @@ -29,9 +27,6 @@ AUTOMAKE_VERSION = 1.16 AUTORECONF = ./autogen.sh CONFIGURE_ARGS += --disable-unicode \ --disable-taskstats - -MODPY_RUNDEP = No -MODPY_VERSION = ${MODPY_DEFAULT_VERSION_3} # htop has some bugs which take hours or days to reach. # Keep the symbols to give a chance to the user to get an useful coredump. Index: distinfo =================================================================== RCS file: /cvs/ports/sysutils/htop/distinfo,v retrieving revision 1.5 diff -u -p -r1.5 distinfo --- distinfo 12 Sep 2020 17:25:21 -0000 1.5 +++ distinfo 29 Nov 2020 20:19:53 -0000 @@ -1,2 +1,2 @@ -SHA256 (htop-3.0.1.tar.gz) = hGUWS8CF9fGBPh0/bEubVr9MlcwSImpTZ+ZXlJSbAco= -SIZE (htop-3.0.1.tar.gz) = 179925 +SHA256 (htop-3.0.2.tar.gz) = tHRKO+onnyo3Je2OXjX/2csQ1mZzvwfI/iH+s8RmEwU= +SIZE (htop-3.0.2.tar.gz) = 176132 Index: patches/patch-CPUMeter_c =================================================================== RCS file: /cvs/ports/sysutils/htop/patches/patch-CPUMeter_c,v retrieving revision 1.7 diff -u -p -r1.7 patch-CPUMeter_c --- patches/patch-CPUMeter_c 21 Nov 2020 15:50:40 -0000 1.7 +++ patches/patch-CPUMeter_c 29 Nov 2020 20:19:53 -0000 @@ -3,7 +3,7 @@ $OpenBSD: patch-CPUMeter_c,v 1.7 2020/11 Index: CPUMeter.c --- CPUMeter.c.orig +++ CPUMeter.c -@@ -233,6 +233,10 @@ static void SingleColCPUsMeter_draw(Meter* this, int x +@@ -202,6 +202,10 @@ static void SingleColCPUsMeter_draw(Meter* this, int x int start, count; AllCPUsMeter_getRange(this, &start, &count); for (int i = 0; i < count; i++) { Index: patches/patch-FunctionBar_c =================================================================== RCS file: /cvs/ports/sysutils/htop/patches/patch-FunctionBar_c,v retrieving revision 1.3 diff -u -p -r1.3 patch-FunctionBar_c --- patches/patch-FunctionBar_c 26 Jul 2018 12:49:04 -0000 1.3 +++ patches/patch-FunctionBar_c 29 Nov 2020 20:19:53 -0000 @@ -6,7 +6,7 @@ so we leak for now. Index: FunctionBar.c --- FunctionBar.c.orig +++ FunctionBar.c -@@ -72,14 +72,8 @@ FunctionBar* FunctionBar_new(const char* const* functi +@@ -59,14 +59,8 @@ FunctionBar* FunctionBar_new(const char* const* functi } void FunctionBar_delete(FunctionBar* this) { Index: patches/patch-Header_c =================================================================== RCS file: /cvs/ports/sysutils/htop/patches/patch-Header_c,v retrieving revision 1.2 diff -u -p -r1.2 patch-Header_c --- patches/patch-Header_c 21 Nov 2020 15:50:40 -0000 1.2 +++ patches/patch-Header_c 29 Nov 2020 20:19:53 -0000 @@ -1,17 +1,15 @@ -$OpenBSD: patch-Header_c,v 1.2 2020/11/21 15:50:40 sthen Exp $ +$OpenBSD: patch-Header_c,v 1.2 2020/11/21 15:50:40 sthen Exp $ Index: Header.c --- Header.c.orig +++ Header.c -@@ -192,8 +192,9 @@ void Header_draw(const Header* this) { +@@ -168,7 +168,8 @@ void Header_draw(const Header* this) { Header_forEachColumn(this, col) { Vector* meters = this->columns[col]; for (int y = (pad / 2), i = 0; i < Vector_size(meters); i++) { - Meter* meter = (Meter*) Vector_get(meters, i); -- meter->draw(meter, x, y, width); + Meter* meter = (Meter*) Vector_get(meters, i); + if (meter == 0x1 || meter->draw == 0x1) continue; -+ meter->draw(meter, x, y, width); + meter->draw(meter, x, y, width); y += meter->h; } - x += width + pad; Index: patches/patch-Vector_c =================================================================== RCS file: /cvs/ports/sysutils/htop/patches/patch-Vector_c,v retrieving revision 1.2 diff -u -p -r1.2 patch-Vector_c --- patches/patch-Vector_c 26 Jul 2018 12:49:04 -0000 1.2 +++ patches/patch-Vector_c 29 Nov 2020 20:19:53 -0000 @@ -6,7 +6,7 @@ so we leak for now. Index: Vector.c --- Vector.c.orig +++ Vector.c -@@ -53,8 +53,8 @@ void Vector_delete(Vector* this) { +@@ -34,8 +34,8 @@ void Vector_delete(Vector* this) { if (this->array[i]) Object_delete(this->array[i]); } Index: patches/patch-openbsd_OpenBSDProcessList_c =================================================================== RCS file: /cvs/ports/sysutils/htop/patches/patch-openbsd_OpenBSDProcessList_c,v retrieving revision 1.3 diff -u -p -r1.3 patch-openbsd_OpenBSDProcessList_c --- patches/patch-openbsd_OpenBSDProcessList_c 29 Nov 2020 20:15:05 -0000 1.3 +++ patches/patch-openbsd_OpenBSDProcessList_c 29 Nov 2020 20:19:53 -0000 @@ -3,15 +3,15 @@ $OpenBSD: patch-openbsd_OpenBSDProcessLi Index: openbsd/OpenBSDProcessList.c --- openbsd/OpenBSDProcessList.c.orig +++ openbsd/OpenBSDProcessList.c -@@ -79,24 +79,36 @@ typedef struct OpenBSDProcessList_ { +@@ -30,24 +30,36 @@ in the source distribution for its full text. static long fscale; - ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { + ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) { - int mib[] = { CTL_HW, HW_NCPU }; ++ int nmib[] = { CTL_HW, HW_NCPU }; + int mib[] = { CTL_HW, HW_NCPUONLINE }; int fmib[] = { CTL_KERN, KERN_FSCALE }; - int i, e; -+ int nmib[] = { CTL_HW, HW_NCPU }; + int ncmib[] = { CTL_KERN, KERN_CPUSTATS, 0 }; + int i, e, ncpu, cpu_index_c; OpenBSDProcessList* opl; @@ -27,7 +27,7 @@ Index: openbsd/OpenBSDProcessList.c + size_ncpu = sizeof(int); + size_cpustats = sizeof(cpu_stats); + cpu_index_c = 0; - ProcessList_init(pl, Class(OpenBSDProcess), usersTable, pidWhiteList, userId); + ProcessList_init(pl, Class(OpenBSDProcess), usersTable, pidMatchList, userId); e = sysctl(mib, 2, &pl->cpuCount, &size, NULL, 0); if (e == -1 || pl->cpuCount < 1) { @@ -43,12 +43,10 @@ Index: openbsd/OpenBSDProcessList.c size = sizeof(fscale); if (sysctl(fmib, 2, &fscale, &size, NULL, 0) < 0) { -@@ -112,6 +124,19 @@ ProcessList* ProcessList_new(UsersTable* usersTable, H - opl->kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf); - if (opl->kd == NULL) { +@@ -65,6 +77,19 @@ ProcessList* ProcessList_new(UsersTable* usersTable, H errx(1, "kvm_open: %s", errbuf); -+ } -+ + } + + for (i = 0; i < ncpu; i++) { + ncmib[2] = i; + sysctl(ncmib, 3, &cpu_stats, &size_cpustats, NULL, 0); @@ -60,10 +58,12 @@ Index: openbsd/OpenBSDProcessList.c + if (cpu_index_c == pl->cpuCount) { + break; + } - } - ++ } ++ return pl; -@@ -372,7 +397,7 @@ static void OpenBSDProcessList_scanCPUTime(OpenBSDProc + } + +@@ -323,7 +348,7 @@ static void OpenBSDProcessList_scanCPUTime(OpenBSDProc u_int64_t avg[CPUSTATES] = {0}; for (int i = 0; i < this->super.cpuCount; i++) { Index: patches/patch-openbsd_OpenBSDProcessList_h =================================================================== RCS file: /cvs/ports/sysutils/htop/patches/patch-openbsd_OpenBSDProcessList_h,v retrieving revision 1.2 diff -u -p -r1.2 patch-openbsd_OpenBSDProcessList_h --- patches/patch-openbsd_OpenBSDProcessList_h 21 Nov 2020 15:50:40 -0000 1.2 +++ patches/patch-openbsd_OpenBSDProcessList_h 29 Nov 2020 20:19:53 -0000 @@ -3,7 +3,7 @@ $OpenBSD: patch-openbsd_OpenBSDProcessLi Index: openbsd/OpenBSDProcessList.h --- openbsd/OpenBSDProcessList.h.orig +++ openbsd/OpenBSDProcessList.h -@@ -39,6 +39,7 @@ typedef struct OpenBSDProcessList_ { +@@ -36,6 +36,7 @@ typedef struct OpenBSDProcessList_ { CPUData* cpus; Index: patches/patch-openbsd_OpenBSDProcess_c =================================================================== RCS file: /cvs/ports/sysutils/htop/patches/patch-openbsd_OpenBSDProcess_c,v retrieving revision 1.2 diff -u -p -r1.2 patch-openbsd_OpenBSDProcess_c --- patches/patch-openbsd_OpenBSDProcess_c 26 Jul 2018 12:49:04 -0000 1.2 +++ patches/patch-openbsd_OpenBSDProcess_c 29 Nov 2020 20:19:53 -0000 @@ -3,9 +3,10 @@ $OpenBSD: patch-openbsd_OpenBSDProcess_c This function is called at the wrong time and will cause use-after-free's, so we leak for now. ---- openbsd/OpenBSDProcess.c.orig Tue Nov 15 16:49:01 2016 -+++ openbsd/OpenBSDProcess.c Tue Nov 15 16:49:12 2016 -@@ -193,9 +193,7 @@ OpenBSDProcess* OpenBSDProcess_new(Settings* settings) +Index: openbsd/OpenBSDProcess.c +--- openbsd/OpenBSDProcess.c.orig ++++ openbsd/OpenBSDProcess.c +@@ -173,9 +173,7 @@ OpenBSDProcess* OpenBSDProcess_new(Settings* settings) } void Process_delete(Object* cast) { Index: patches/patch-openbsd_Platform_c =================================================================== RCS file: /cvs/ports/sysutils/htop/patches/patch-openbsd_Platform_c,v retrieving revision 1.8 diff -u -p -r1.8 patch-openbsd_Platform_c --- patches/patch-openbsd_Platform_c 11 Sep 2020 12:34:28 -0000 1.8 +++ patches/patch-openbsd_Platform_c 29 Nov 2020 20:19:53 -0000 @@ -3,7 +3,7 @@ $OpenBSD: patch-openbsd_Platform_c,v 1.8 Index: openbsd/Platform.c --- openbsd/Platform.c.orig +++ openbsd/Platform.c -@@ -235,7 +235,7 @@ void Platform_setSwapValues(Meter* this) { +@@ -227,7 +227,7 @@ void Platform_setSwapValues(Meter* this) { this->total = pl->totalSwap = total; this->values[0] = pl->usedSwap = used;