OpenBSD cvs log

created 2018-12-03T16:33:28Z
begin 2018-11-17T00:00:00Z
end 2018-11-18T00:00:00Z
path src/sys
commits 3

date 2018-11-17T18:55:50Z
author millert
files src/sys/kern/kern_event.c log diff annotate
message Avoid leaking kernel memory in struct kevent padding.
From NetBSD (maxv). OK deraadt@ visa@

date 2018-11-17T20:17:10Z
author mpi
files src/sys/dev/usb/usb_subr.c log diff annotate
src/sys/dev/usb/usbdivar.h log diff annotate
message free(9) size for USB subdevs array.

ok ratchov@, visa@

date 2018-11-17T23:10:08Z
author cheloha
files src/sys/kern/kern_pledge.c log diff annotate
src/sys/kern/kern_sched.c log diff annotate
src/sys/kern/kern_sysctl.c log diff annotate
src/sys/sys/sched.h log diff annotate
src/sys/sys/sysctl.h log diff annotate
message Add new KERN_CPUSTATS sysctl(2) so we can identify offline CPUs.

Because of hw.smt we need a way to determine whether a given CPU is "online"
or "offline" from userspace. KERN_CPTIME2 is an array, and so cannot be
cleanly extended for this purpose, so add a new sysctl(2) KERN_CPUSTATS
with an extensible struct. At the moment it's just KERN_CPTIME2 with a
flags member, but it can grow as needed.

KERN_CPUSTATS appears to have been defined by BSDi long ago, but there are
few (if any) packages in the wild still using the symbol so breakage in ports
should be near zero. No other system inherited the symbol from BSDi, either.

Then, use the new sysctl(2) in systat(1) and top(1):

- systat(1) draws placeholder marks ('-') instead of percentages for
offline CPUs in the cpu view.

- systat(1) omits offline CPU ticks when drawing the "big bar" in
the vmstat view. The upshot is that the bar isn't half idle when
half your logical CPUs are disabled.

- top(1) does not draw lines for offline CPUs; if CPUs toggle on or
offline in interactive mode we redraw the display to expand/reduce
space for the new/missing CPUs. This is consistent with what some
top(1) implementations do on Linux.

- top(1) omits offline CPUs from the totals when CPU totals are
combined into a single line (the '-1' flag).

Originally prompted by deraadt@. Discussed endlessly with deraadt@,
ketennis@, and sthen@. Tested by jmc@ and jca@. Earlier versions also
discussed with jca@. Earlier versions tested by jmc@, tb@, and many

docs ok jmc@, kernel bits ok ketennis@, everything ok sthen@,
"Is your stuff in yet?" deraadt@