-style(9) nits
MFC Log:
Fix long standing race condition associated with how lockf uses open(2)
for mutual exclusion:
A brief description of the problem:
1) Proc A picks up non-blocking lock on file X
2) Proc B attempts to pickup lock, fails then waits
3) Proc C attempts to pickup lock, fails then waits
4) Proc A releases lock
5) Proc B acquires lock, release it to pickup a non-blocking version
6) Proc C acquires lock, release it to pickup a non-blocking version
7) Both process B and C race each other to pickup lock again
This occurs mainly because the processes do not keep the lock after they have
been waiting on it. They drop it, attempt to re-acquire it. (They use the wait
to notify when the lock has become available then race to pick it up). This
results in additional CPU utilization during the race, and can also result
in processes picking locks up out of order.
This change attempts to correct this problem by eliminating the test/acquire
race and having the operating system handle it.
Un-break processing of device major/minor values with fstat -n. We do
this by accessing the cdev_priv element of the cdev structure. Looking
forward we need a better way to handle this, as this structure shouldn't
be frobbed by userspace.
Teach vmstat's domemstat_zone() to use memstat_kvm_uma() when the kvm
descriptor is non-NULL, restoring vmstat -z support for core dumps and
kmem access. These were broken with the introduction of UMA.
Bug fix: a numeric flag specification in the substitute command would
cause the next substitute flag to be ignored.
While working at it, detect and report overflows.
Reported by: Jingsong Liu
Bugged by: Xin Li
Approved by: re (kensmith)
- Print space character in show_stat(). Remove a lot of priuntf(" ").
- Utilize show_stat() in sidewaysintpr() loop. This makes periodic
statistics to honor -h flag.
Approved by: re (kensmith)
The bsdtar_warnc() reporting function requires the program name to be
set up before it is called, so move the progname initialization before
the first possible call to bsdtar_warnc().
Thanks to: Stanislav Sedov
PR: bin/83366
Approved by: re (scottl)
Add a new switch -h for interface stats mode, which prints all interface
statistics in human readable form.
In collaboration with: vsevolod
Reviewed by: cperciva
Approved by: re (kensmith)
Teach vmstat -m and vmstat -z to use libmemstat(3). Certain
statistics from -z are now a bit different due to changes in the
way statistics are now measured. Reproduce with some amount of
accuracy the slightly obscure layouts adopted by the two kernel
sysctls. In the future, we might want to normalize them.
GC dosysctl(), which is now no longer used.
Merge vmstat.c:1.88 from HEAD to RELENG_6:
Minor syntax tweaks:
- Remove some extra blank lines.
- Remove comments that don't contribute to understanding.
- Remove additional blank lines in output added to maximize
compatibility with older vmstat output, but that is actually
somewhat gratuitous.
Submitted by: bde
Approved by: re (kensmith)
date: 2005/07/30 20:00:13; author: csjp; state: Exp; lines: +16 -4
Introduce kdevtoname, which when given the kernel address of a
cdev structure, returns the device name associated with it through
the __si_namebuf member. This un-breaks the processing of devices.
Approved by: re (kensmith)
Modify "netstat -mb" to use libmemstat(3) when acting on a live system,
with a number of positive benefits:
- Start using UMA(9) statistics for mbufs and clusters, which avoids
using the mbuf allocator statistics which suffer from races under
load on SMP. This should eliminate "negative" mbuf counts in
netstat -mb.
- We are now able to track cached (free) mbufs and clusters and count
it towards memory allocated by the network stack.
- We are now also able to track memory allocated to mbuf tags since
libmemstat(3) can also query malloc(9). We don't print this except
as part of the total (for now - #if 0).
- We are now able to track mbuf/cluster/packet allocation failures,
although they are not currently printed (#if 0).
- Don't print out sfbuf statistics when running on a kernel core, as
currently that code is able only to query sysctl for statistics.
mbuf.c:1.44:
Since libmemstat(3) now supports its own error management mechanism,
use that instead of trying to use errno, in order to produce a
sensible error message.
Approved by: re (kensmith)
1) An unquoted space is always a separator, even when not "in_arg".
2) When a new destination buffer must be allocated during variable
substitution, only copy data from the active buffer to the new
one when we *are* "in_arg".
3) Fix minor memory leak when expanding ${variable}s
Approved by: re(kensmith)
Fix the "..." special command. If this command is found all further
commands for this target are appended to the .END target instead
of beeing executed now. They are executed when the graph is finished.
There was a bug with executing the .END target which came in when
doing conversion to LST_FOREACH() which caused make to dump core.
PR: bin/83698
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Approved by: re
- Remove MLINKS to nonexistant manpages
- Change some section numbers to match reality
- For MLINKS to manpages from ports, mention which port installs them
Approved by: re (hrs)
was a separator character immediately before it. This wasn't likely to
happen in #-lines, but we might as well get it right. Also fix it so
that "" and "" will create a zero-length argument.
Approved by: re (blanket `env')
start with a '/', they are more supported (by POSIX and SUSv3) than
filenames which have an '=' in them.
Noticed by: tjr
Approved by: re (blanket `env')
apart a string, and supports some text substitutions. This can be
used to provide all the flexibility (and more!) that was lost by recent
changes to how the kernel parses #!-lines in shell scripts.
The '-P' option provides a way to specify an alternate set of directories
to use when searching for the 'utility' program to run. This way you can
be sure what directories are used for that search, without changing the
value of PATH that the user has set. Note that on FreeBSD 6.0, this
option is worthless unless the '-S' option is also used.
Approved by: re (blanket `env')