Several of the subtypes have an associated vnode which is used for
stuff like the f*() functions.
By giving the vnode a speparate field, a number of checks for the specific
subtype can be replaced simply with a check for f_vnode != NULL, and
we can later free f_data up to subtype specific use.
At this point in time, f_data still points to the vnode, so any code I
might have overlooked will still work.
Ian Dowse [Sun, 22 Jun 2003 03:20:24 +0000 (03:20 +0000)]
When DDB is active, always send printf() output directly to the
console, even if there is a TIOCCONS console tty. We were already
doing this after a panic, but it's also useful when entering DDB
for some other reason too.
Ian Dowse [Sun, 22 Jun 2003 02:54:33 +0000 (02:54 +0000)]
Use a new message buffer `consmsgbuf' to forward messages to a
TIOCCONS console (e.g. xconsole) via a timeout routine instead of
calling into the tty code directly from printf(). This fixes a
number of cases where calling printf() at the wrong time (such as
with locks held) would cause a panic if xconsole is running.
The TIOCCONS message buffer is 8k in size by default, but this can
be changed with the kern.consmsgbuf_size sysctl. By default, messages
are checked for 5 times per second. The timer runs and the buffer
memory remains allocated only at times when a TIOCCONS console is
active.
Alan Cox [Sun, 22 Jun 2003 02:35:06 +0000 (02:35 +0000)]
Complete the vm object locking in vm_object_backing_scan(); specifically,
deal with the case where we need to sleep on a busy page with two vm object
locks held.
John-Mark Gurney [Sun, 22 Jun 2003 02:26:17 +0000 (02:26 +0000)]
use a REG macro that was already defined.
Reorder how the pci probing in handled. before adding devices, check to
see if the slot is a multi-function device to see if we should probe all
the functions.
Ian Dowse [Sun, 22 Jun 2003 02:18:31 +0000 (02:18 +0000)]
Replace the code for reading and writing the kernel message buffer
with a new implementation that has a mostly reentrant "addchar"
routine, supports multiple message buffers in the kernel, and hides
the implementation details from callers.
The new code uses a kind of sequence number to represend the current
read and write positions in the buffer. This approach (suggested
mainly by bde) permits the read and write pointers to be maintained
separately, which reduces the number of atomic operations that are
required. The "mostly reentrant" above refers to the way that while
it is now always safe to have any number of concurrent writers,
readers could see the message buffer after a writer has advanced
the pointers but before it has witten the new character.
Kirk McKusick [Sat, 21 Jun 2003 21:01:44 +0000 (21:01 +0000)]
Increase the size of the NFS server hash table to improve performance
when serving up more than about 32 active files. For details see
section 6.3 (pg 111) of Daniel Ellard and Margo Seltzer, ``NFS
Tricks and Benchmarking Traps'' in the Proceedings of the Usenix
2003 Freenix Track, June 9-14, 2003 pg 101-114.
Obtained from: Daniel Ellard <ellard@eecs.harvard.edu>
Sponsored by: DARPA & NAI Labs.
Warner Losh [Sat, 21 Jun 2003 20:27:54 +0000 (20:27 +0000)]
Add clarifications about the information that ntp_gettime returns.
TAI is a timescale, just like UTC. The tai field returns the offset
between the two, and isn't really used for precision time keeping.
Explain in brief what a positive and a negative leap seconds are. Add
some URLs to very useful web pages about time and time keeping for
more information on using this API.
Hajimu UMEMOTO [Sat, 21 Jun 2003 10:14:52 +0000 (10:14 +0000)]
Though manpage says that 0.0.0.0 can be used as HISADDR for gw
in Framed-Route, it didn't work. Since ncprange_aton() treats
0.0.0.0 and :: as prefixlen=0, we need to care the case.
Alan Cox [Sat, 21 Jun 2003 04:14:48 +0000 (04:14 +0000)]
- Increase the scope of the vm object lock in vm_object_collapse().
- Assert that the vm object and its backing vm object are both locked in
vm_object_qcollapse().
Jeff Roberson [Sat, 21 Jun 2003 02:31:49 +0000 (02:31 +0000)]
- lticks was erroneously being updated in sched_pctcpu(). This was causing
us to skip the pctcpu_update() call which lead to inaccurate cpu usage
statistics for processes that didn't run often.
Jeff Roberson [Sat, 21 Jun 2003 02:22:47 +0000 (02:22 +0000)]
- Don't allow nice to have such a large effect on priority. This was
causing poor interactive performance while unnice processes were running.
The new scheme still allows nice to have an effect on priority but it is
not as dramatic as the effect of the interactivity score.
Warner Losh [Fri, 20 Jun 2003 21:14:59 +0000 (21:14 +0000)]
ntp_adjtime returns the current state of the clock (TIME_*) on success
or -1 on failure. The manual used to say it returned 0 or -1. Both
examination of the kernel sources, and ntpd show that this is the case.
Tim J. Robbins [Fri, 20 Jun 2003 14:52:52 +0000 (14:52 +0000)]
Merge from NetBSD src/sys/ntfs/ntfs_subr.c 1.5 & 1.30 (jdolecek):
- Avoid calling bread() with different sizes on the same blkno.
Although the buffer cache is designed to handle differing size
buffers, it erroneously tries to write the incorrectly-sized buffer
buffer back to disk before reading the correctly-sized one, even
when it's not dirty. This behaviour caused a panic for read-only
NTFS mounts when INVARIANTS was enabled ("bundirty: buffer x still
on queue y"), reported by NAKAJI Hiroyuki.
- Fix a bug in the code handling holes: a variable was incremented
instead of decremented, which could cause an infinite loop.
Stefan Eßer [Fri, 20 Jun 2003 12:15:37 +0000 (12:15 +0000)]
The assertions generated to test VFS locking never included checks
for vnodes reached through double indirection (i.e. **vpp). This
is worked-around by special-casing the identifier "vpp" (adding one
level of indirection).
The alternative fix mentioned in the PR had required substantial
changes to this script.
In case there are locking violations that had been hidden without
this patch, they may suddenly show up, now ...
This change does not affect code compiled without DEBUG_VFS_LOCKS.
David Xu [Fri, 20 Jun 2003 09:12:12 +0000 (09:12 +0000)]
cpu_set_upcall_kse needs to access userspace, release schedule lock
before calling it for bound thread. To avoid this problem, change
thread_schedule_upcall to not put new thread on run queue, let caller
do it, so we can tweak the new thread before setting it to run.
Alan Cox [Fri, 20 Jun 2003 04:20:36 +0000 (04:20 +0000)]
The so-called "optimized copy-on-write fault" case should not require
the vm map lock. What's really needed is vm object locking, which
is (for the moment) provided Giant.
David Xu [Fri, 20 Jun 2003 03:36:45 +0000 (03:36 +0000)]
When a STOP signal is being sent to a process, it is possible all
threads in the process have already masked the signal, so job control
is delayed. But later a thread unmasking the STOP signal should enable
job control, so in issignal(), scanning all threads in process to see
if we can direct suspend some of them, not just suspend current thread.
Alfred Perlstein [Thu, 19 Jun 2003 18:13:07 +0000 (18:13 +0000)]
Unlock the struct file lock before aquiring Giant, otherwise
we can deadlock because of lock order reversals. This was not
caught because Witness ignores pool mutexes right now.
Murray Stokely [Thu, 19 Jun 2003 07:24:26 +0000 (07:24 +0000)]
phk added the -x option in May 2000, but only for regular files; for
special files it was treated like -l. This commit adds the -x option
in for special files as well.
PR: bin/46249
Submitted by: Colin Percival <cperciva@sfu.ca>
Murray Stokely [Thu, 19 Jun 2003 07:02:00 +0000 (07:02 +0000)]
In the build process, fortune files have been randomized since at
least the 4.4-lite days. This is pointless, since fortune(6) performs
its own randomization. It was also problematic for binary update
systems such as ports/security/freebsd-update. This commit simply
removes the -r option to strfile so that the datfiles are constant.
Jake Burkholder [Thu, 19 Jun 2003 05:27:04 +0000 (05:27 +0000)]
- Rename the IPI_WAIT macro to IPI_DONE.
- Don't require all receivers of ipis to wait for all other receivers,
only that the sender wait for all receivers. This should reduce the
amount of time spent with interrupts disabled, which may be a cause
of ipi timeouts.