bde [Sat, 5 Jan 2008 08:54:51 +0000 (08:54 +0000)]
In sequential_heuristic():
- spell 16384 as 16384 and not as BKVASIZE. 16384 is (not quite) just a
magic size that works well in practice. BKVASIZE should be MAXBSIZE
(65536), but is 16384 because i386's don't have enough kva for it to
be MAXBSIZE; 16384 works (not so well) for it for much the same reasons
that it works well in the heuristic.
- expand and/or add comments about this and other details.
- don't explicitly inline this function.
- fix some other style bugs.
peter [Sat, 5 Jan 2008 08:35:56 +0000 (08:35 +0000)]
Fall back to the binary-specified interpreter (ld-elf.so.1) if the
ABI override binary isn't found. This could probably be smoother, but
it is what I did in p4 change #126891 on 2007/09/27. It should solve
the "ld-elf32.so.1"-in-chroot problem.
jasone [Thu, 3 Jan 2008 23:22:13 +0000 (23:22 +0000)]
Enable both sbrk(2)- and mmap(2)-based memory acquisition methods by
default. This has the disadvantage of rendering the datasize resource
limit irrelevant, but without this change, legitimate uses of more
memory than will fit in the data segment are thwarted by default.
Fix chunk_alloc_mmap() to work correctly if initial mapping is not
chunk-aligned and mapping extension fails.
des [Thu, 3 Jan 2008 17:54:26 +0000 (17:54 +0000)]
Add an internal utility function to simplify the many, many places where
the number of bytes read is actually not important as long as we have at
least what we ask for. Illustrate its benefits by using it throughout
the ZIP support code, except for the few cases where it doesn't apply.
kib [Thu, 3 Jan 2008 12:28:57 +0000 (12:28 +0000)]
ffs_balloc_ufsX() routines, in the case of recovering from the failed
allocation, free the indirect blocks before clearing the disk pointers,
that could lead to the softupdate inconsistencies in the case of the
machine or disk crash at the wrong time.
Rearrange the recover code to do the ffs_blkfree() after the second
ffs_syncvnode(), that clears the pointers chain.
Proposed and reviewed by: tegge
Tested by: Peter Holm
MFC after: 3 weeks
jeff [Thu, 3 Jan 2008 01:26:59 +0000 (01:26 +0000)]
- In sysctl_kern_file skip fdps with negative lastfiles. This can
happen if there are no files open. Accounting for these can
eventually return a negative value for olenp causing sysctl to
crash with a bad malloc.
alc [Wed, 2 Jan 2008 08:54:39 +0000 (08:54 +0000)]
Provide a legitimate pindex to vm_page_alloc() in pmap_growkernel()
instead of writing apologetic comments. As it turns out, I need every
kernel page table page to have a legitimate pindex to support superpage
promotion on kernel memory.
Correct a nearby style error: Pointers should be compared to NULL.
alc [Wed, 2 Jan 2008 04:43:47 +0000 (04:43 +0000)]
Defer setting either PG_CACHED or PG_FREE until after the free page
queues lock is acquired. Otherwise, the state of a reservation's
pages' flags and its population count can be inconsistent. That could
result in a page being freed twice.
kientzle [Wed, 2 Jan 2008 00:27:14 +0000 (00:27 +0000)]
A couple of miscellaneous fixes:
* prototypes for optarg/optind on platforms that don't already have them
* Disambiguate version number macros
* Remove unnecessary PACKAGE_NAME macro
* Hook for forthcoming bsdtar test suite
* Sync version number up with the portable distribution
kientzle [Wed, 2 Jan 2008 00:21:27 +0000 (00:21 +0000)]
Use archive_entry_strmode() instead of a local bsdtar_strmode().
(This does a couple of things that the standard library's strmode()
doesn't; it proved useful in bsdcpio as well, so I pushed it down
into libarchive.)
kientzle [Tue, 1 Jan 2008 22:28:04 +0000 (22:28 +0000)]
Extensive improvements to the libarchive_test test program that
exercises and verifies the libarchive APIs:
* Improved error reporting; hexdumps are now provided for
many file/memory content differences.
* Overall status more clearly counts "tests" and "assertions"
* Reference files can now be stored on disk instead of having
to be compiled into the test program itself. A couple of
tests have been converted to this more natural structure.
* Several memory leaks corrected so that leaks within libarchive
itself can be more easily detected and diagnosed.
* New test: GNU tar compatibility
* New test: Zip compatibility
* New test: Zero-byte writes to a compressed archive entry
* New test: archive_entry_strmode() format verification
* New test: mtree reader
* New test: write/read of large (2G - 1TB) entries to tar archives
(thanks to recent performance work, this test only requires a few seconds)
* New test: detailed format verification of cpio odc and newc writers
* Many minor additions/improvements to existing tests as well.
kientzle [Tue, 1 Jan 2008 06:15:57 +0000 (06:15 +0000)]
Add the mtree.5 manpage. I'll come back soon and
remove the format specification from mtree.8.
I also need to reconcile a few issues between this
mtree.5 and what is actually implemented in FreeBSD's
mtree utility.
kensmith [Tue, 1 Jan 2008 03:59:17 +0000 (03:59 +0000)]
Change sysinstall's handling of X11 stuff. Doing it in pieces was
probably the right thing to do a while ago but xorg has progressed
to the point that for novice users (who are the ones expected to think
installing X11 during an install...) it's best to just install the
whole x11/xorg metaport for them. This removes the X11 sub-menus
and sets it up so you just select whether or not you want X11. While
here garbage collect an X11 configuration menu I missed removing when
I removed support for attempting xorg configuration from inside sysinstall
a while ago.
Discussed with: rwatson, kris
No objection from: re
Release build tested by: rwatson
jeff [Tue, 1 Jan 2008 01:46:42 +0000 (01:46 +0000)]
- Place the fhold() in unp_internalize_fp to be more consistent with refs.
- Clear all of the gc flags before doing a run. Stale flags were causing
us to skip some descriptors.
- If a unp socket has been marked REF in a gc pass it can't be dead.
julian [Mon, 31 Dec 2007 23:48:06 +0000 (23:48 +0000)]
Don't duplicate the whole of arpresolve to arpresolve 2 for the sake
of two compares against 0. The negative effect of cache flushing
is probably more than the gain by not doing the two compares (the
value is almost certainly in register or at worst, cache).
Note that the uses of m_freem() are in error cases and m_freem()
handles NULL anyhow. So fast-path really isn't changed much at all.
jhb [Mon, 31 Dec 2007 21:12:05 +0000 (21:12 +0000)]
Add very basic support for the kernel to export a list of features. Each
feature is represented by a node in the new 'kern.features' sysctl node.
A feature is present if the corresponding node is present and evaluates to
true.
A FEATURE() wrapper macro is added which takes the sysctl node name and
a description of the feature as the sole arguments and creates a read-only
sysctl node with a value of 1.
rwatson [Mon, 31 Dec 2007 20:58:50 +0000 (20:58 +0000)]
Update netisr comment for the SMPng world order: netisr is no longer
implemented using the ISR facility, and cannot be triggered by calling
splnet()/splx().
rwatson [Mon, 31 Dec 2007 16:45:27 +0000 (16:45 +0000)]
Add regression tests for UNIX domain socket garbage collection. Should be
run from single-user mode, as they look at global open file and inflight
descriptor counts to check for leaks.
jhb [Mon, 31 Dec 2007 15:56:03 +0000 (15:56 +0000)]
Use devclass_get_count() instead of devclass_get_maxunit() to get the
correct number of acpi_thermalX devices. Having this wrong caused the
acpi_thermal thread to realloc the array of devices on each loop iteration.
MFC after: 1 week
PR: kern/118497
Submitted by: Pasi Parviainen
jasone [Mon, 31 Dec 2007 06:19:48 +0000 (06:19 +0000)]
Fix a major chunk-related memory leak in chunk_dealloc_dss_record(). [1]
Clean up DSS-related locking and protect all pertinent variables with
dss_mtx (remove dss_chunks_mtx). This fixes race conditions that could
cause chunk leaks.
jeff [Mon, 31 Dec 2007 03:45:51 +0000 (03:45 +0000)]
- Pause a while after disabling lock profiling and before resetting it
to be sure that all participating CPUs have stopped updating it.
- Restore the behavior of printing the name of the lock type in the output.
imp [Mon, 31 Dec 2007 03:29:02 +0000 (03:29 +0000)]
Add Winbond W89C940F to the list. Also, stub in some entries for two
Holtek cards that will need some special support later, but leave them
commented out for now.
These ID's are transcribed from the Linux ne2k-pci.c
jasone [Mon, 31 Dec 2007 00:59:16 +0000 (00:59 +0000)]
Fix a bug related to sbrk() calls that could cause address space leaks.
This is a long-standing bug, but until recent changes it was difficult
to trigger, and even then its impact was non-catastrophic, with the
exception of revision 1.157.
Optimize chunk_alloc_mmap() to avoid the need for unmapping pages in the
common case. Thanks go to Kris Kennaway for a patch that inspired this
change.
Do not maintain a record of previously mmap'ed chunk address ranges.
The original intent was to avoid the extra system call overhead in
chunk_alloc_mmap(), which is no longer a concern. This also allows some
simplifications for the tree of unused DSS chunks.
Introduce huge_mtx and dss_chunks_mtx to replace chunks_mtx. There was
no compelling reason to use the same mutex for these disjoint purposes.
Avoid memset() for huge allocations when possible.
Maintain two trees instead of one for tracking unused DSS address
ranges. This allows scalable allocation of multi-chunk huge objects in
the DSS. Previously, multi-chunk huge allocation requests failed if the
DSS could not be extended.
imp [Sun, 30 Dec 2007 05:53:45 +0000 (05:53 +0000)]
Rather than not redirting the bp when we get ENXIO, only redirty it
when the error is EIO. This catches a much larger class of errors
that are unlikely to succeed if retried.
kientzle [Sun, 30 Dec 2007 04:58:22 +0000 (04:58 +0000)]
Update libarchive to 2.4.10. This includes a number of improvements
that I've been working on but put off committing until after the
RELENG_7 branch, including:
* New manpages: cpio.5 mtree.5
* New archive_entry_strmode()
* New archive_entry_link_resolver()
* New read support: mtree format
* Internal API change: read format auction only runs once
* Running the auction only once allowed simplifying a lot of bid logic.
* Cpio robustness: search for next header after a sync error
* Support device nodes on ISO9660 images
* Eliminate a lot of unnecessary copies for uncompressed archives
* Corrected handling of new GNU --sparse --posix formats
* Correctly handle a zero-byte write to a compressed archive
* Fixed memory leaks
Many of these improvements were motivated by the upcoming bsdcpio
front-end.
There have also been extensive improvements to the libarchive_test
test harness, which I'll commit separately.
jeff [Sun, 30 Dec 2007 01:43:51 +0000 (01:43 +0000)]
- Update kvm_deadfiles to be compatible with the new system which has no
global list of all files.
- Mark kvm_getfiles() as broken since the live version exports struct xfile
with no filelist at the head and does so incorrectly and the deadfiles
version exports struct file with a filelist at the head. It is not known
if either version works or complies to the manpage.
jeff [Sun, 30 Dec 2007 01:42:15 +0000 (01:42 +0000)]
Remove explicit locking of struct file.
- Introduce a finit() which is used to initailize the fields of struct file
in such a way that the ops vector is only valid after the data, type,
and flags are valid.
- Protect f_flag and f_count with atomic operations.
- Remove the global list of all files and associated accounting.
- Rewrite the unp garbage collection such that it no longer requires
the global list of all files and instead uses a list of all unp sockets.
- Mark sockets in the accept queue so we don't incorrectly gc them.
marius [Sun, 30 Dec 2007 01:32:03 +0000 (01:32 +0000)]
o In preparation for basing a new driver on this one:
- ANSIfy
- try to bring closer to style(9)
- remove banal comments.
o Add my copyright for having done lots of fixes and improvements.
marius [Sun, 30 Dec 2007 00:23:38 +0000 (00:23 +0000)]
Correct the comments in am7990_intr() and am79900_intr(); it's not
possible to end up in the interrupt handler again while processing the
previous RX interrupt in ifp->if_input() because the MD interrupt code
disables the delivery of the respective interrupt until all associated
handlers were called (in the INTR_FILTER case the MI code supposedly
does the same). Toggling the NIC interrupt enable bit in these handlers
still is necessary though as some chips (f.e. the VMware emulated one)
require this to be done in order to keep issuing interrupts.
wkoszek [Sat, 29 Dec 2007 23:26:59 +0000 (23:26 +0000)]
Replace explicit calls to video methods with their respective variants
implemented with macros. This patch improves code readability. Reasoning
behind vidd_* is a sort of "video discipline".
List of macros is supposed to be complete--all methods of video_switch
ought to have their respective macros from now on.
Functionally, this code should be no-op. My intention is to leave current
behaviour of touched code as is.
No objections: rwatson
Silence on: freebsd-current@
Approved by: cognet
wkoszek [Sat, 29 Dec 2007 21:55:25 +0000 (21:55 +0000)]
Remove explicit calls to keyboard methods with their respective variants
implemented with macros. This patch improves code readability. Reasoning
behind kbdd_* is a "keyboard discipline".
List of macros is supposed to be complete--all methods of keyboard_switch
should have their respective macros from now on.
Functionally, this code should be no-op. My intention is to leave current
behaviour of code as is.
alc [Sat, 29 Dec 2007 19:53:04 +0000 (19:53 +0000)]
Add the superpage reservation system. This is "part 2 of 2" of the
machine-independent support for superpages. (The earlier part was
the rewrite of the physical memory allocator.) The remainder of the
code required for superpages support is machine-dependent and will
be added to the various pmap implementations at a later date.
Initially, I am only supporting one large page size per architecture.
Moreover, I am only enabling the reservation system on amd64. (In
an emergency, it can be disabled by setting VM_NRESERVLEVELS to 0
in amd64/include/vmparam.h or your kernel configuration file.)
mav [Sat, 29 Dec 2007 19:44:41 +0000 (19:44 +0000)]
Add support for optional "AC-Name\Service-Name" syntax at NGM_PPPOE_CONNECT
argument. It allows ppp, mpd or any other node consumer to request
connection to specified access concentrator.
Proposed by: Alexander A. Burylov <burylov@mail.ru>
ache [Sat, 29 Dec 2007 16:28:15 +0000 (16:28 +0000)]
Comments fixing
"month names" -> "months names"
typo
"Long months names (alternative)" or "in alternative form" ->
"(without case ending)"
"Long months names" -> "Long months names (as in a date)"
to not confuse developers on what purpose those sections are
kib [Sat, 29 Dec 2007 14:25:29 +0000 (14:25 +0000)]
Apply the LCONVPATH() to the (old) linux_stat() and linux_lstat() syscalls.
Without it, code has two problems:
- behaviour of the old and new [l]stat are different with regard of
the /compat/linux
- directly accessing the userspace data from the kernel asks for
the panics.
Reported and tested by: Peter Holm
Reviewed by: rdivacky
MFC after: 3 days
kib [Sat, 29 Dec 2007 13:31:27 +0000 (13:31 +0000)]
The ffs_balloc() routines, whan allocating the indirect blocks for
the inode, do the rollback in case the allocation failed (due to
insufficient free space or quota limits). But, the code does leaves the
buffers corresponding to the inoirect blocks on the vnode bufobj list.
This causes several assertion failures (for instance, "ffs_truncate3"
in ffs_truncate()) to fail, and could result in the indirect block
aliasing problem, like writing the context of such blocks to random
disk location.
Remove the buffers from the bufobj properly.
Reported and tested by: Peter Holm
Reviewed by: tegge
MFC after: 3 weeks
imp [Sat, 29 Dec 2007 05:15:54 +0000 (05:15 +0000)]
Some systems need the types defined in sys/types.h, but lack the
sys/types.h polution that FreeBSD has in one of its include files.
Since this is a bootstrap tool, include more than is strictly
necessary for FreeBSD.
kensmith [Sat, 29 Dec 2007 04:56:07 +0000 (04:56 +0000)]
Plug a memory leak. Once any given package (e.g. perl) was installed
we would leak a saved screen for every other package we tried to install
that listed perl as one of its dependencies. When installing things
like gnome and kde that wound up being a LOT of leaked memory.
Insta-MFC request coming so this can be tested as part of 6.3-RC2...