into its own function, udp6_append(). This mirrors a similar structure
in udp_input() and udp_append(), and makes the whole thing a lot more
readable.
While here, add missing inpcb locking in UDP6 input path.
Reviewed by: bz
MFC after: 3 months
to the unused kva in the pv memory block to thread a freelist through.
This allows us to free pages that used to be used for pv entry chunks
since we can now track holes in the kva memory block.
Idea from: ups
vmstat.c:
Move totfr to be under daefr and prcfr since it logically belongs there.
Move all the count fields (wire, act, inact, cache and free) to near
the bottom of the sub-display (after all the rate fields) to reduce
competition with adjoining sub-displays.
systat.1:
Move things as above.
Attempt to improve missing and poor wording in the description of the
fields. The long sentence was hard to parse and didn't say anything
about the different units.
Increment .Dd.
in part by OpenBSD's not-quite-standard-compliant
standard libraries. (No loss of functionality,
just minor recoding to not rely on certain "standard"
facilities that weren't actually needed.)
part that handled the 17th and 18th rows of the vmstat-proper subdisplay
was deleted in rev.1.10 when these rows stopped being used and was not
restored when the 17th row was used again. For such terminals, we now
lose the `buf' field instead of making a mess with it. Terminals with
fewer than 24 rows have never been supported.
The problem is not avoided by using curses since we use the last line
for data entry and don't use a separate subwindow for this line.
Some other things in the vmstat display could be handled better using
subwindows.
output too.
Fine tune all coordinates and most field widths in the vmstat (sub)display
for this and previous changes now that we have to change almost all of them
just to move the ex-extended fields:
- change VMSTATROW back to 7. It was 6 due to a hack in the extended vm
stats changes.
- reduce the maximum field width that we try for from 9 to 8. 4 or 5 is
enough for most fields but we try to use the same width for all fields.
8 is enough to display everything without changing units memory sizes
exceed 100GB.
Fix some unrelated coordinates and field widths in comments.
vm stats to the normal vm stats. Sort them into the normal stats
according to the man page only in the source code so that diffs are
almost readable. Reduce style bugs in printing the value of %ozfod.
new vnstat display to the right of the namei display.
Move the non-vmstat fields {des,num,fre}vn from the vmstat display to a
new vnstat display. Move the dtbuf field there too. The buf and dtbuf
fields are non-vmstat and non-vnstat, so there is no good place to
display them. I need to move at least 1 of them out of the vm stats
for further cleanups of the vm stats, and there is only space for 1
of them in the vn stats. (The best place for the current buf field
is actually /dev/null, since it has been completely broken for about
10 years and broken for longer. It gives an uninteresting virtual
memory count where an interesting real memory count is wanted.)
to handle changes to the set of disks selected, but it is unnecessary
for that since the whole screen is redrawn when this set is changed.
It was also buggy:
- MAXDRIVES*6 = 42 was hard-coded as only 30 spaces in a string literal,
the last 2 disk names were not cleared as intended
- when the extended vmstats are active, clearing of even 30 columns
overruns the ozfod value field by 3 columns. This was harmless because
the field is much wider than necessary.
value printed is actually the optimized (i.e., the non-slow, not-on-the-fly
zero fills percentage) except in overflow cases. Describe it as %ozfod
in the display. Move the field descriptor 1 to the left so that there
is space for 5 characters after the % sign (this leaves no space between
the number and the descriptor but the % character serves well as a
separator).
Fixed integer overflow at z.ozfod = UINT_MAX/100 in the calculation of
%ozfod. This value can be reached just a few hours or minutes after
booting, so %ozfod was usually garbage in boot mode. Now %ozfod is
correct in boot mode for a few days or hours.
Print a non-dummy %ozfod when the division for it isn't division by 0
instead of when the result will be less than 100%. A result of 100%
may be correct, though a result of more than 100% indicates overflow
of one or both counters.
not very usefully, in all other displays). This was the original point
of the PR.
Move the load average up by 2 so that it starts in row 0 for all windows
(2 lines above it were wasted for all other windows except vmstat).
Move everything below it up by 2 or 3 (3 for icmp and icmp6 which had
an extra blank line due from not compensating for the foot-shooting in
note (3); only ip and ip6 compensated). Reduce the magic numbers related
to this.
Notes by the submitter:
%%%
1. All the subwin() calls are identical using #define MAINWIN_ROW 3
(systat.h).
2. The load average is at the top of the window.
3. Each display starts on the fourth line. I made changes to those
displays that shifted the start line (i.e., icmp). This entailed a
lot of changes within the comments at the top of those displays.
4. For ip6, I shifted the "Input next-header histogram" column down one
row to separate it from "IPv6 Output". I raised "bad scope packets"
and "address selection failed" up one row to stay with "IPv6 Input"
(valid?). They were down one row to probably line up at the bottom,
but I think they should stick with their fellow items in a column.
5. I condensed ifstat a bit. It had a lot of empty rows.
%%%
Submitted by: Se=E1n Farley <sean-freebsd at farley dot org>
PR: bin/81874
only affect amd64 and i386. alpha uses "intr N" instead of "irqN" and
mostly has no device names. ia64 uses only device names.
- Edit interrupt names once after they are read from the kernel and not
every time they are displayed.
- Discard bogus trailing spaces so that the next step doesn't move things
to oblivion.
- If an interrupt name starts with "irqN:" (as it usually does in on
amd64 and i386), then move "irqN" to the end and strip ":", since we
have no space for the ":" and don't want to start descriptions with
"N" after stripping "irq" in the next step (since "N" would look like
a count). This step may need reworking for interrupt names containing
several device names -- then moving the irq number to the end would
lose it instead of losing some device names.
- Remove "irq" from an interrupt name if and only if the original name is
too long to display.
accidentally.
Read buffer overruns:
The size of the target array (TSOTTA == 10) is a wrong limit to use for
scanning the source string.
Write buffer overruns:
TSOTTA is also a wrong limit to use for copying to the target buffer,
since we want to add a NUL terminator afterwards. TSOTTA was also 1
too small for holding both the desired number of visible characters
and the NUL.
Worked accidentally:
There is error in the algorithm that tends to result in the space saved
by stripping "irq" not actually being used, but some cases worked
accidentally provided "irqN" is near the end of the source string and
"N" is only 1 digit.
Starting with 5.mumble-CURRENT, "irqN" is at the beginning of the
string on all (?) arches that have it and the accidents don't happen.
E.g. on i386's, the keyboard irq is now named
"irq1: atkbd0<bogus blank padding>" by the kernel, and this name was
converted to "1: atkb" -- not only the device number but part of the
device name has been lost --, while before 5.mumble the kernel name
was "atkbd0 irq1" and systat accidentally preserved the irq number to
give "atkbd0 1". The ":" in the string wastes precious space, and
stripping "irq" results in descriptions starting with numbers which
makes them look too much like counts. This commit just fixes the last
problem.
vn_start_write() is always called earlier in the code path and calling
the function recursively may lead to a deadlock.
Confirmed by: tegge
MFC after: 2 weeks
clobbered at runtime:
dirtybuf -> dtbuf
desiredvnodes -> desvn
numvnodes -> numvn
freevnodes -> frevn
The vmstats column has only 5 characters available for descriptors, but up
to 13 were used. The extras get clobbered at runtime by interrupt values
and/or descriptors on systems with more than 12 interrupt sources.
%slo-z -> %sloz
This one is in the "extended" vmstats area and doesn't get clobbered now.
Removed stale documentation of desvn.
Changed a descriptor:
tfree -> totfr
so that it is consistent with the abbreviations for other free counts
(daefr and prcfr) and thus almost decodeable.
Fixed missing documentation of tfree/totfr. This and everything else
in the extended vmstats area is misdocumented as being in a certain
place in the vmstats column.
An mtree description of all non-zero files that make
distribution installs (only size and md5) is built from the
temproot. When the user completes a mergemaster run, the
mtree description file gets installed into /var/db for
safe-keeping.
When the user then decides to do a subsequent upgrade (with
the -U flag), the existing mtree description from /var/db
is called into service looking for files that are different in
DESTDIR. This is stashed away until a file that would normally
end up prompting the user to look at changes is encountered.
Since there are no user modified changes, the new file is
installed without bothering the user.
Looked at by: dougb
MFC after: 6 weeks