David E. O'Brien [Tue, 25 Feb 2003 20:59:23 +0000 (20:59 +0000)]
Move most everything back to a MI NOTES, and use "nodevice" in MD NOTES
Where needed. Use 'sed' for now in place of "nooptions". Add a sparc64
MD NOTES.
Jake Burkholder [Tue, 25 Feb 2003 19:40:21 +0000 (19:40 +0000)]
- Added inlines pmap_is_current, pmap_is_alternate and pmap_set_alternate
for testing and setting the current and alternate address spaces.
- Changed PTDpde and APTDpde to arrays to support multiple page directory
pages.
Tim J. Robbins [Tue, 25 Feb 2003 15:10:23 +0000 (15:10 +0000)]
Allocate struct ipx_ifaddrs with an initial reference count of 1, not 0.
The wrong reference count was causing them to get freed too early and
have their contents scrambled.
Fix a long-standing bug where if the package being deleted had no
post-deinstall script, the variable intended to hold the name of that
script would be used uninitialized. In some cases, fexists() would
succeed, causing pkg_delete to try to chmod +x it, then execute it,
resulting in bizarre error messages such as:
.//: Permission denied
This bug would normally only occur when multiple packages were
specified on the command line; otherwise post_script would be located
in a previously unused part of the stack, and implicitly (but quite
accidentally) initialized to all-zeros.
Robert Watson [Tue, 25 Feb 2003 14:08:41 +0000 (14:08 +0000)]
When generating a TCP response to a connection, not only test if the
tcpcb is NULL, but also its connected inpcb, since we now allow
elements of a TCP connection to hang around after other state, such
as the socket, has been recycled.
Julian Elischer [Tue, 25 Feb 2003 09:49:46 +0000 (09:49 +0000)]
Catch up with change to kse_release syscall.
The background info in this man page needs rewriting
in some parts since the last major changes
to the code, however it still accuratly reflects how to use the
API.
Søren Schmidt [Tue, 25 Feb 2003 08:22:01 +0000 (08:22 +0000)]
Revert the probe code change.
It helped those fake devices probe delays to go away, but as a side
effect it also made some not so conforming CD/DVD drives go away...
Kirk McKusick [Tue, 25 Feb 2003 06:44:42 +0000 (06:44 +0000)]
Prevent large files from monopolizing the system buffers. Keep
track of the number of dirty buffers held by a vnode. When a
bdwrite is done on a buffer, check the existing number of dirty
buffers associated with its vnode. If the number rises above
vfs.dirtybufthresh (currently 90% of vfs.hidirtybuffers), one
of the other (hopefully older) dirty buffers associated with
the vnode is written (using bawrite). In the event that this
approach fails to curb the growth in it the vnode's number of
dirty buffers (due to soft updates rollback dependencies),
the more drastic approach of doing a VOP_FSYNC on the vnode
is used. This code primarily affects very large and actively
written files such as snapshots. This change should eliminate
hanging when taking snapshots or doing background fsck on
very large filesystems.
Hopefully, one day it will be possible to cache filesystem
metadata in the VM cache as is done with file data. As it
stands, only the buffer cache can be used which limits total
metadata storage to about 20Mb no matter how much memory is
available on the system. This rather small memory gets badly
thrashed causing a lot of extra I/O. For example, taking a
snapshot of a 1Tb filesystem minimally requires about 35,000
write operations, but because of the cache thrashing (we only
have about 350 buffers at our disposal) ends up doing about
237,540 I/O's thus taking twenty-five minutes instead of four
if it could run entirely in the cache.
Reported by: Attila Nagy <bra@fsn.hu>
Sponsored by: DARPA & NAI Labs.
Jeff Roberson [Tue, 25 Feb 2003 03:37:48 +0000 (03:37 +0000)]
- Add an interlock argument to BUF_LOCK and BUF_TIMELOCK.
- Remove the buftimelock mutex and acquire the buf's interlock to protect
these fields instead.
- Hold the vnode interlock while locking bufs on the clean/dirty queues.
This reduces some cases from one BUF_LOCK with a LK_NOWAIT and another
BUF_LOCK with a LK_TIMEFAIL to a single lock.
Maxime Henrion [Tue, 25 Feb 2003 03:21:22 +0000 (03:21 +0000)]
Cleanup of the d_mmap_t interface.
- Get rid of the useless atop() / pmap_phys_address() detour. The
device mmap handlers must now give back the physical address
without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
int. Now we properly pass a vm_offset_t * and expect it to be
filled by the mmap handler when the mapping was successful. The
mmap handler must now return 0 when successful, any other value
is considered as an error. Previously, returning -1 was the only
way to fail. This change thus accidentally fixes some devices
which were bogusly returning errno constants which would have been
considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
no longer used.
- Convert all the d_mmap_t consumers to the new API.
I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.
Discussed with: alc, phk, jake
Reviewed by: peter
Compile-tested on: LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on: i386
Marcel Moolenaar [Tue, 25 Feb 2003 00:42:40 +0000 (00:42 +0000)]
Remove support for running in SimOS. The support has rotted over
time and there's no indication that it will improve anytime soon.
By removing support for SimOS it is possible to build LINT on
Alpha, which is considered more important at the moment.
Jake Burkholder [Mon, 24 Feb 2003 20:29:52 +0000 (20:29 +0000)]
- Removed UMAXPTDI and UMAXPTEOFF.
- Changed VM_MAXUSER_ADDRESS to be defined in terms of PTDPTDI. In order for
assumptions about the recursive page table map to work it must be the base
of the recursive map. Any pte offset that's not NPTEPG will break these
assumptions.
Ruslan Ermilov [Mon, 24 Feb 2003 20:09:16 +0000 (20:09 +0000)]
Ensure that build-tools end up in the object directory different
from the source directory. (This mostly affects the RELENG_4's
``make release'' release.5 target, where "rtermcap" build-tool
for release/sysinstall ends up in the source directory and later
steps of release.5 wipe it out.)
David Schultz [Mon, 24 Feb 2003 08:51:31 +0000 (08:51 +0000)]
- Add a clearer error message for the case where swapon hits the
NSWAPDEV limit.
- Don't warn about devices that are not in use in 'swapoff -a'.
- Re-add behavior mistakenly removed in revision 1.44:
If using 'swapon -a', do not warn if the device is already in use.
PR: 46633
Submitted by: Andy Farkas <andyf@speednet.com.au> (in part)
Reviewed by: mike (mentor)
David Schultz [Mon, 24 Feb 2003 08:49:59 +0000 (08:49 +0000)]
Expand the reference count on struct dquot to 32 bits.
This fixes a panic on large systems where a single user
may have more than 64K active or inactive vnodes.
Marcel Moolenaar [Mon, 24 Feb 2003 08:07:05 +0000 (08:07 +0000)]
Third attempt at removing machdep.h and using ALIGN from <sys/param.h>.
The initial stack_block is staticly allocated and will be aligned
according to the alignment requirements of pointers, which does not
necessarily match the alignment enforced by ALIGN. To solve this a
more involved change is required: remove the static initial stack
and deal with an initial condition of not having a stack at all. This
change is therefore more risky than the previous ones, but unavoidable
(other than not using the platform default alignment).
Discussed with: tjr
Approved and reviewed by: tjr
Tested on: alpha, i386, ia64 and sparc64
Sam Leffler [Mon, 24 Feb 2003 06:10:50 +0000 (06:10 +0000)]
o add -b option to enable batching
o add #ifdef __FreeBSD__'s around the profiling so the code compiles on openbsd
o update a comment about expected performance for Broadcom hardware
Sam Leffler [Mon, 24 Feb 2003 06:03:13 +0000 (06:03 +0000)]
o instead of applying arbitrary tunables, just honor the COP_F_BATCH
flag that can be marked on each symmetric op
o eliminate hw.ubsec.maxbatch and hw.ubsec.maxaggr since they are not
needed anymore
o change ubsec_feed to return void instead of int since zero is always
returned and noone ever looked at the return value
Scott Long [Mon, 24 Feb 2003 05:46:55 +0000 (05:46 +0000)]
Don't NULL out p_fd until after closefd() has been called. This isn't
totally correct, but it has caused breakage for too long. I welcome
someone with more fd fu to fix it correctly.
1) Fix so -a honors the -n ("do nothing") option. Before, if the directory
given for -a did not exist, then newsyslog would always try to create
it, even if -n was specified.
2) When -a processing *does* create the directory, have it check the result
from mkdir(), and immediately error-out if that failed.
Add the idea of a "default rotate action", which will be used if a file is
specified at runtime, but that filename is not listed in the newsyslog.conf
file. This default-action can be changed by having a line in newsyslog.conf
with the filename of "<default>". Before this change, the program would
quietly ignore the given file. An update to the man page will be written
after I finish some other updates to newsyslog.c.
Reviewed by: no objections from freebsd-arch
MFC after: 3 weeks
Jake Burkholder [Mon, 24 Feb 2003 00:39:50 +0000 (00:39 +0000)]
Use the direct mapping of IdlePTD setup in locore for proc0's page directory,
instead of allocating another page of kva and mapping it in again. This was
likely an oversight in revision 1.174 (cut and paste from pmap_pinit).
Marcel Moolenaar [Sun, 23 Feb 2003 23:09:17 +0000 (23:09 +0000)]
Use the correct size for reading and writing the PCI config space.
Reading the PCI config space with the wrong (larger) size is not
a problem in this case, but writing can be as it clobbers unrelated
registers. In this case the clobbering is for reserved fields, which
too is mostly harmless... for now. Hence, this change is mostly
preventive in nature.