| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
reported by Bryan Linton
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
others.
docs ok jmc@, kernel bits ok ketennis@, everything ok sthen@,
"Is your stuff in yet?" deraadt@
|
|
|
|
| |
ok kettenis deraadt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lets userspace distinguish between idle CPUs and those that are
not schedulable because hw.smt=0.
A subsequent commit probably needs to add documentation for this
to sysctl.2 (and perhaps elsewhere) after the dust settles.
Also included here are changes to systat(1) and top(1) that account
for the ENODEV case and adjust behavior accordingly:
- systat(1)'s cpu view prints placeholder marks ('-') instead of
percentages for each state if the given CPU is offline.
- systat(1)'s vmstat view checks for offline CPUs when computing the
machine state total and excludes them, so the CPU usage graph
only represents the states for online CPUs.
- top(1) does not draw CPU rows for offline CPUs when the view is
redrawn. If CPUs "go offline", percentages for each state are
replaced by placeholder marks ('-'); the view will need to be
redrawn to remove these rows. If CPUs "go online" the view will
need to be redrawn to show these new CPUs. In "combined CPU" mode,
the count and the state totals only represent online CPUs.
Ports using KERN_CPTIME2 will need to be updated. The changes
described above to make systat(1) and top(1) aware of the ENODEV
case *and* gracefully handle a changing HW_NCPUONLINE while the
application is running are not necessarily appropriate for each
and every port.
The changes described above are so extensive in part to demonstrate
one way a program *might* be made robust to changing CPU availability.
In particular, changing hw.smt after boot is an extremely rare event,
and this needs to be weighed when updating ports.
The logic needed to account for the KERN_CPTIME2 ENODEV case is
very roughly:
if (sysctl(...) == -1) {
if (errno != ENODEV) {
/* Actual error occurred. */
} else {
/* CPU is offline. */
}
} else {
/* CPU is online and CPU states were set by sysctl(2). */
}
Prompted by deraadt@. Basic idea for ENODEV from kettenis@. Discussed at
length with kettenis@. Additional testing by tb@.
No complaints from hackers@ after a week.
ok kettenis@, "I think you should commit [now]" deraadt@
|
|
|
|
|
|
| |
displayed lines. Makes vmstat view in tall windows easier to read.
ok sthen@
|
|
|
|
|
|
|
| |
a busy machine would look idle. As %Nic does not fit in the columns,
add it to %Usr. Introduce @ for spinning time to keep the characters
people are used to. Put %Spn between %Int and %Sys like in top.
OK visa@ mpi@
|
|
|
|
|
|
|
|
|
| |
system time.
Introduce a new CP_SPIN "scheduler state" and modify userland tools
to display the % of timer a CPU spents spinning.
Based on a diff from jmatthew@, ok pirofti@, bluhm@, visa@, deraadt@
|
|
|
|
| |
ok tb@
|
|
|
|
|
|
|
| |
Leftovers from the re-engining of systat eight years ago. Makes gcc
quieter.
ok otto@ deraadt@
|
|
|
|
|
|
| |
Convert bzero() to memset() and bcopy() to memcpy()
ok natano@ millert@
|
|
|
|
| |
ok krw millert
|
|
|
|
|
| |
(pfvar.h nameser.h proc.h ucred.h)
ok guenther millert, and some review from doug as well.
|
|
|
|
| |
ok tedu@
|
|
|
|
|
|
|
|
|
|
| |
related to disk stastics for almost 17 years, and the remaining
userland-visible defines duplicate those found in <sys/sched.h>.
Move the remaining _KERNEL defines to <sys/tty.h> where they belong, and
update all users to cope with this.
ok kettenis@
|
|
|
|
|
|
|
| |
include <sys/vmmeter.h> where it is needed instead of relying on
it being included by <uvm/uvm_extern.h>.
miod@ likes it, ok guenther@
|
| |
|
| |
|
|
|
|
| |
tedu agreed with an idea, tested by Luis Useche and me; ok deraadt
|
|
|
|
|
|
|
| |
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
|
| |
|
|
|
|
|
|
| |
rates at the same time as interrupt counts, so sneak them into the
bottom corner of the vmstat screen
ok dlg
|
|
|
|
| |
the next unit K->M->G. ok deraadt@
|
|
|
|
| |
get really fast; ok canacar
|
| |
|
|
|
|
|
|
|
|
| |
the misses field may report negative values. The hit/miss numbers
does not exactly reflect the statistics collected by the kernel
but this is close enough.
Report & patch from Bjorn Anderss, input from beck@ and thib@
|
| |
|
|
|
|
|
|
|
|
| |
(status, state, rule, queue). While all displays work, some keyboard
comands are not implemented yet. Other features include better handling
of display resize and scrolling for long views. Committing now to fix
the remaining issues in the tree.
Testing and comments by otto@ and harding@, ok deraadt@
|
| |
|
|
|
|
| |
them more room. much cleaner, and it is less code too; ok deanna
|
|
|
|
| |
ok a whole lot of devs@
|
|
|
|
|
| |
fudges the output to stay clean when intr time wasnt shown. not needed
since we show it now.
|
|
|
|
| |
tweaks by deraadt@ ok by many
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
the uvm_km_page allocator and use it instead of calling panic()
- add a counter to uvmexp so we can keep track of how many map entries
we have in use
idea from tedu@, long ago, okay deraadt@
|
| |
|
|
|
|
| |
avoid tree breakage)
|
| |
|
|
|
|
|
|
| |
sysctl to fetch interrupt counters on all architectures. Also add new '-z'
flag to vmstat which means show all devices, even those that have not yet
generated an interrupt. deraadt@ tholo@ drahn@ millert@ ok
|
| |
|
| |
|
|
|
|
|
| |
MP machines get interrupt counters. will be replaced by a MI subsystem
one day. most code from drahn, few final bugs fixed by me
|
|
|
|
|
| |
regularily, make the disk columns a little wider so it doesn't run into
the neighboring column, theo ok
|
|
|
|
| |
disk columns. tested by jolan@. from pedro martelletto
|
|
|
|
| |
from Pedro Martelletto <pbastos@rdc.puc-rio.br>
|
|
|
|
|
| |
looked at by various, testing henning@ mcbride@ dan weeks
mostly from netbsd via Pedro Martelletto <pbastos@rdc.puc-rio.br>
|
| |
|
| |
|
|
|
|
| |
rescinded 22 July 1999. Proofed by myself and Theo.
|