Matthew Dillon [Thu, 4 Feb 2010 22:32:11 +0000 (14:32 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Constantine A. Murenin [Thu, 4 Feb 2010 22:08:47 +0000 (17:08 -0500)]
it(4): it3 at port 0x228
* Port 0x228 is quite popular on many motherboards.
* Makes it(4) work on my GIGABYTE GA-MA78GM-S2H (780G / SB700).
Matthew Dillon [Thu, 4 Feb 2010 17:05:57 +0000 (09:05 -0800)]
kernel - SWAP CACHE part 7/many - Add vm_swapcache.c core (write side)
* Add vm_swapcache.c which will be responsible for assigning swap to clean
vnode-backed VM pages and writing the data out.
Implement a very simple inactive queue scanner and swap-writer for
testing.
* Track swap space use, split up into the piece used for anonymous
data and the piece used for clean vnode-backed data.
* Add PG_SWAPPED tracking for newly allocated VM pages via
swap_pager_page_inserted().
* Conditionalize the swap code's dirtying/undirtying of VM pages. We
don't want to mess with the dirty state when working the swap
cache since it isn't the definitive backing store for the VM page.
Matthew Dillon [Thu, 4 Feb 2010 03:24:44 +0000 (19:24 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Constantine A. Murenin [Tue, 2 Feb 2010 23:36:27 +0000 (18:36 -0500)]
syslog: introduce /var/log/daemon
* The idea is taken from OpenBSD.
* The immediate benefit is more informational messages from sensorsd,
e.g. stuff like the total number of sensors, configuration reloads
and 'OK' and 'within' status/state events.
Matthew Dillon [Thu, 4 Feb 2010 03:02:45 +0000 (19:02 -0800)]
kernel - SWAP CACHE part 6/many - Refactor swap_pager_freespace()
* Refactor swap_pager_freespace() to use a RB_SCAN() instead of a
vm_pindex_t iteration. This is necessary if we intend to allow
swap backing store for vnodes because the related files & VM objects
can be huge. This is also generally a good idea in 64-bit mode
to help deal with x86_64's massive address space.
* Start adding swap space freeing calls in the OBJT_VNODE handling code
and generic VM object handling code.
* Remove various checks for OBJT_SWAP from swap*() and swp*() functions
to allow them to be used with OBJT_VNODE objects.
* Add checks for degenerate cases to reduce call overheads as the swap
handling functions are now called for vnode objects too.
* Add assertions for pagers which do not need swap support.
Matthew Dillon [Thu, 4 Feb 2010 01:19:36 +0000 (17:19 -0800)]
kernel - SWAP CACHE part 5/many - Change vm_pindex_t to 64 bits on i386
* Change vm_pindex_t from unsigned long (32 bits) to __uint64_t (64 bits).
This change is necessary to support block devices with greater than 16TB
of storage as well as to support the mmap()ing of HAMMER files larger
than 16TB.
Primarily this was done to support block devices greater than 16TB
since HAMMER volumes are allowed to be up to 4096TB each. Filesystem
mounts use VM objects to back block devices.
* On x86_64 vm_pindex_t is already 64 bits but change the typedef from
unsigned long to __uint64_t to match i386.
* Most conversions to and from vm_pindex_t are to 64 bits anyway so this
change does not create any performance issues.
Matthew Dillon [Thu, 4 Feb 2010 00:50:09 +0000 (16:50 -0800)]
kernel - SWAP CACHE part 4/many - Add PG_SWAPPED
* Add the PG_SWAPPED flag to struct vm_page to indicate when
backing store has been assigned to a VM page.
Matthew Dillon [Wed, 3 Feb 2010 23:19:52 +0000 (15:19 -0800)]
kernel - VM - fix vm_pages_needed race
* vm_page_needed sleep/wakeup can race and cause a wakeup to be missed,
resulting in processes getting stuck in 'pfault' until something else
kicks the pager.
Fix the race.
Matthew Dillon [Wed, 3 Feb 2010 22:45:32 +0000 (14:45 -0800)]
kernel - SWAP CACHE part 3/many - Rearrange VM pagerops
* Remove pgo_init, pgo_pageunswapped, and pgo_strategy
* The swap pager was the only consumer of pgo_pageunswapped and
pgo_strategy. Since these functions will soon operate on any
VM object type and not just OBJT_SWAP there's no point putting
them in pagerops.
* Make swap_pager_strategy() and swap_pager_unswapped() global
functions and call them directly.
Matthew Dillon [Wed, 3 Feb 2010 21:23:58 +0000 (13:23 -0800)]
kernel - syncache - Fix races due to struct syncache not being stable storage
* struct syncache no longer uses stable storage. Proactively delete
tcpcb references to the syncache instead of letting them hang.
Matthew Dillon [Wed, 3 Feb 2010 21:22:23 +0000 (13:22 -0800)]
kernel - jails - Fix NULL pointer deref in prison_remote_ip()
* This might be a bit of a hack but shortcut the routine if
td->td_ucred is NULL. This occurs if the routine is called
via a kernel support thread.
Matthew Dillon [Wed, 3 Feb 2010 19:04:55 +0000 (11:04 -0800)]
AHCI - Improve warning messages when probing for a port multiplier
* Improve the warning messages on the console so the sysad knows the
PM probe failure is just a notification and not actually an error.
Submitted-by: "Edward O'Callaghan" <eocallaghan@auroraux.org>
Matthew Dillon [Wed, 3 Feb 2010 18:24:36 +0000 (10:24 -0800)]
sshd - Add safety measures to the default installed sshd_config
* Uncomment various sshd_config options to enforce their defaults.
This does not make any changes to the current defaults but ensures that
the configuration state for these particular options will not change
if the default happens to be changed in the distributed codebase.
RhostsRSAAuthentication no
HostbasedAuthentication no
IgnoreRhosts yes
* Change the ChallengeResponseAuthentication default from 'yes' to 'no'.
This only applies to PAM and PAM is disabled by default so this change
has no effect unless PAM is enabled by default at some future time.
* For now leave UsePAM commented out, do not enforce its default 'no' state.
The changes above will make it safe if the codebase default changes in
the future. The codebase default is currently 'no'.
* Note that we previously also changed the PasswordAuthentication default
to 'no', so everything is on the same page now.
Suggested-by: Doug Barton <dougb@freebsd.org> (generally)
Matthew Dillon [Wed, 3 Feb 2010 18:23:36 +0000 (10:23 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Sascha Wildner [Wed, 3 Feb 2010 15:36:28 +0000 (16:36 +0100)]
make upgrade: Don't remove /etc/upgrade/Makefile_upgrade.inc upon completion.
It's not dangerous to 'make upgrade' more than once and it's even useful
when testing.
Matthew Dillon [Wed, 3 Feb 2010 05:58:40 +0000 (21:58 -0800)]
kernel - SWAP CACHE part 2/many - Remove VM pager lists
* VM pager lists were used to associate handles with VM objects. Only the
device_pager actually used them. Store the VM object in cdev_t->si_object
instead and remove the device pager's VM pager list.
* phys_pager and swap_pager only use anonymous objects, the VM pager lists
were implemented but not used. Assert that the handles are NULL and remove
the VM pager lists.
* Remove vm_pager_object_lookup().
Matthew Dillon [Wed, 3 Feb 2010 04:36:21 +0000 (20:36 -0800)]
kernel - SWAP CACHE part 1/many - Convert swblock to a Red-Black tree
* Convert struct swblock from being hashed to a per-vm_object RB tree.
This remove two pointers from struct swblock but adds a RB_ENTRY which
is three pointers and an integer, so swblock gets a little more
bloated.
* Optimize swp_pager_meta_free_all(). We previously indexed through
the entire VM object's size which doesn't scale well for 64-bit
or for swap-cached vnodes. Now we need only iterate the RB tree.
* Move swblock fields out of the VM pager union and make them part of the
native vm_object structure. Swap block assignments will soon be allowed
on vnodes for fast data caching.
Stathis Kamperis [Tue, 2 Feb 2010 22:52:07 +0000 (00:52 +0200)]
HAMMER Utility - Handle PFS#0 case in 'snapls' directive
Since we are here, fix a memory leak.
Stathis Kamperis [Tue, 2 Feb 2010 19:45:24 +0000 (21:45 +0200)]
HAMMER Utility - Extend output in 'snapls' directive.
Matthew Dillon [Tue, 2 Feb 2010 18:17:52 +0000 (10:17 -0800)]
HAMMER Utility - Revise snaprm documentation
* Do a better job documenting the various arguments to the
snaprm directive.
Matthew Dillon [Tue, 2 Feb 2010 17:51:00 +0000 (09:51 -0800)]
HAMMER VFS - Fix assertion when taking snapshot
* hammer_ioc_add_snapshot() issues an ASOF lookup for the snapshot and
then a non-ASOF insertion (insertions never use ASOF). However, the
ASOF lookup can modify the cursor's key (cursor.key_beg).
This mismatch between the cursor's key and the leaf being inserted can
then result in an assertion in the btree insertion code.
* Reloading the key before doing the insertion fixes the problem. Also
document the case.
Reported-by: Stathis Kamperis <ekamperi@gmail.com>
Matthew Dillon [Sun, 31 Jan 2010 23:39:26 +0000 (15:39 -0800)]
kernel - IF_NFE - Continue work on word alignment support
* Add a capability and enable word-alignment conditionally. For now
just enable it for the MCP77 and MCP79 chipsets.
* Note that the CK804 family does not appear to support 2-byte
DMA alignment.
Reported-by: Rumko
Matthew Dillon [Sun, 31 Jan 2010 22:08:56 +0000 (14:08 -0800)]
kernel - NFS - Document an issue with nfs_realign()
* Document the fact that nfs_realign() must use blocking mbuf allocations
or risk locking up TCP NFS mount connections due to TCP NFS mounts not
retrying RPCs unless the link itself is lost.
Matthew Dillon [Sun, 31 Jan 2010 18:18:25 +0000 (10:18 -0800)]
kernel - SILI disk driver - Add support for Sil3124
* Sil3124 uses the same chipset ABI as the 3134 but with 4 ports
instead of 2. It appears to only need a PCI entry.
* This is for the PCI-X 3124. The 3124A is a PCI-e version which
probably will also work (not yet tested), and for which we still
need the PCI ID.
Submitted-by: Tim Darby <t+dfbsd@timdarby.net>
Sascha Wildner [Sun, 31 Jan 2010 17:19:26 +0000 (18:19 +0100)]
Regenerate sysproto.h (forgotten in last commit to syscalls.master).
Sascha Wildner [Sun, 31 Jan 2010 16:50:11 +0000 (17:50 +0100)]
POSIX says mprotect(2)'s first argument shall not be const.
Matthew Dillon [Sun, 31 Jan 2010 05:49:59 +0000 (21:49 -0800)]
kernel - NFE - Align packet data payload
* Offset the RX ring DMA by 2 bytes so the IP header, TCP header, and
payload is aligned after the 6-byte MAC header.
EM does the same thing.
* Reduces NFS overhead during bcopy()s and also avoids triggering
nfs_realign.
Sascha Wildner [Sun, 31 Jan 2010 05:26:42 +0000 (06:26 +0100)]
periodic.conf.5: Update for pkgsrc checks.
Describe the recently added variables so that people actually know about
them.
Adapted-from: NetBSD
Sascha Wildner [Sun, 31 Jan 2010 04:37:20 +0000 (05:37 +0100)]
Sync zoneinfo database with tzdata2010b from elsie.
northamerica: 8.28 -> 8.30
zone.tab: 8.31 -> 8.33
Beginning in 2010, several Mexican cities near the north border will share
their DST schedule with the United States.
This requires splitting up several zones (adding new ones for those
cities).
Sascha Wildner [Sun, 31 Jan 2010 04:20:20 +0000 (05:20 +0100)]
md5.1: Clean up the last commit a bit.
Constantine A. Murenin [Sat, 30 Jan 2010 09:45:01 +0000 (04:45 -0500)]
acpi.4: Xr aibs(4)
Constantine A. Murenin [Sat, 30 Jan 2010 09:44:41 +0000 (04:44 -0500)]
aibs(4): s/misformed/malformed/; suggested by Paul Goyette
Constantine A. Murenin [Sat, 30 Jan 2010 09:44:23 +0000 (04:44 -0500)]
aibs(4): use ACPI_INTEGER and PRIx64; suggested by Jukka Ruohonen
Matthew Dillon [Fri, 29 Jan 2010 18:55:34 +0000 (10:55 -0800)]
kernel - Fix issue in UFS related to new nvtruncbuf() API use
* When a UFS truncation must downsize a block it must sometimes call
FSYNC twice, the second time to flush out softdep block dependencies
related to the original indirect block.
UFS depends on the first FSYNC call to prevent the buffer cache buffer
straddling the new file/directory EOF from becoming dirty. However,
nvtruncbuf() defeats this by re-dirtying the bp.
The solution is to simply undirty the bp prior to the second FSYNC,
which works fine since it will be written out later with a b*write()
anyway.
* Fixes 'locking against myself' panic w/UFS.
Reported-by: Stathis Kamperis <ekamperi@gmail.com>
Matthew Dillon [Thu, 28 Jan 2010 17:04:34 +0000 (09:04 -0800)]
kernel - Even more buffer cache / VM coherency work
* nvtruncbuf/nvextendbuf now clear the cached layer 2 disk offset
from the buffer cache buffer being zero-extended or zero-truncated.
This is required by HAMMER since HAMMER never overwrites data
in the same media block.
* Convert HAMMER over to the new nvtruncbuf/nvextendbuf API.
The new API automatically handles zero-truncations and zero-extensions
within the buffer straddling the file EOF and also changes the way
backing VM pages are handled. Instead of cutting the VM pages off
at the nearest boundary past file EOF any pages in the straddling
buffer are left fully valid and intact, which avoids numerous pitfalls
the old API had in dealing with VM page valid/dirty bits during
file truncations and extensions.
* Make sure the PG_ZERO flag in the VM page is cleared in allocbuf().
* Refactor HAMMER's strategy code to close two small windows of
opportunity where stale data might be read from the media. In
particular, refactor hammer_ip_*_bulk(), hammer_frontend_trunc*(),
and hammer_io_direct_write(). These were detected by the fsx test
program on a heavily paging system with physical memory set artificially
low.
Data flows through three stages in HAMMER:
(1) Buffer cache.
(2) In-memory records referencing the direct-write data offset on the
media until the actual B-Tree is updated on-media at a later time.
(3) Media B-Tree lookups referencing the committed data offset on the
media.
HAMMER must perform a careful, fragile dance to ensure that access to
the data from userland doesn't slip through any cracks while the data
is transitioning between stages. Two cracks were found and fixed:
(A) The direct-write code was allowing the BUF/BIO in the strategy
call to complete before adding the in-memory record to the index
for the stage 1->2 transition. Now fixed.
(B) The HAMMER truncation code was skipping in-memory records queued
to the backend flusher under the assumption that the backend
flusher would deal with them, which it will eventually, but there
was a small window where the data was still accessible by userland
after the truncation if userland did a truncation followed by an
extension. Now fixed.
Matthew Dillon [Tue, 26 Jan 2010 20:50:33 +0000 (12:50 -0800)]
HAMMER VFS - Disallow rebalancing on small-memory machines
* Rebalancing may have to hold upwards of 3900 buffers locked
in the worst case, disallow the operation on machines which
do not configure enough buffer cache buffers.
Matthew Dillon [Tue, 26 Jan 2010 20:41:03 +0000 (12:41 -0800)]
kernel - More buffer cache / VM coherency work
* Add a buffer offset argument to nvtruncbuf(). The truncation length and
blocksize for the block containing the truncation point alone are
insufficient since prior blocks might be using a different blocksize.
* Add a buffer offset argument to nvnode_pager_setsize() for the same
reason.
* nvtruncbuf() and nvextendbuf() now bdwrite() the buffer being zero-filled.
This fixes a race where the clean buffer might be discarded and read
from the medias pre-truncation backing store again before the filesystem
has a chance to adjust it.
* nvextendbuf() now takes additional arguments. The block offset for the
old and new blocks must be passed.
* Convert UFS over to the use nv*() API, hopefully solving any remaining
fsx VM/BUF coherency issues.
* Correct bugs with swap_burst_read mode, but leave the mode disabled.
There are still unresolved issues when the mode is enabled.
(Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>)
* Fix a bug in vm_prefault() which would leak VM pages, eventually
causing the machine to run out of memory.
Jan Lentfer [Tue, 26 Jan 2010 17:33:00 +0000 (18:33 +0100)]
groff: Fixup after new version import
* adds a patch based on current groff cvs
that fixes error messages during man lint
runs
* Fixup tmac/Makefile to take new files
into account
Jan Lentfer [Tue, 26 Jan 2010 09:08:46 +0000 (10:08 +0100)]
groff: Update master to work with v1.20.1
* updated patches to apply cleanly
* removed one obsolete patch
Jan Lentfer [Mon, 25 Jan 2010 22:04:24 +0000 (23:04 +0100)]
groff: update vendor branch to v1.20.1
Jan Lentfer [Mon, 25 Jan 2010 21:45:51 +0000 (22:45 +0100)]
groff: Update master to work without version tag
Jan Lentfer [Mon, 25 Jan 2010 21:38:11 +0000 (22:38 +0100)]
groff: remove version tag from directory
Matthew Dillon [Mon, 25 Jan 2010 23:39:37 +0000 (15:39 -0800)]
includes - Shift inclusion of sys/event.h from sys/file.h
* sys/file.h was including sys/event.h for struct klist, but
only the kernle needs it. Shift the inclusion from outside
to inside the _KERNEL conditional.
* Should fix the pkgsrc build of databases/db4 and databases/db46.
Reported-by: Goetz Isenmann <g.isenmann@science-computing.de>
Jan Lentfer [Mon, 25 Jan 2010 20:44:38 +0000 (21:44 +0100)]
file: updated master to v5.04
Jan Lentfer [Mon, 25 Jan 2010 20:11:28 +0000 (21:11 +0100)]
Merge branch 'vendor/FILE'
Jan Lentfer [Mon, 25 Jan 2010 19:07:20 +0000 (20:07 +0100)]
file: update vendor branch to v5.04
Jan Lentfer [Mon, 25 Jan 2010 18:35:05 +0000 (19:35 +0100)]
sendmail: Update master to work with v8.14.4
* Removed some now obsolete patches
* Made remaining patches apply cleanly
Jan Lentfer [Mon, 25 Jan 2010 18:31:01 +0000 (19:31 +0100)]
Merge branch 'vendor/SENDMAIL'
Jan Lentfer [Mon, 25 Jan 2010 18:25:08 +0000 (19:25 +0100)]
sendmail: Update vendor branch to v8.14.4
Jan Lentfer [Sun, 24 Jan 2010 11:41:26 +0000 (12:41 +0100)]
periodic/security: minor fixes to 670.pkgsraudit
* rc was only set to 1 when but never to 0
* pkgsrc tools where not in PATH so when run
from crontab it wouldn't work
Jan Lentfer [Sat, 23 Jan 2010 22:34:08 +0000 (23:34 +0100)]
periodic/security: remove signature check
* this was committed accidently and untested
and leads to vulnerabilitiy files not
downloaded because extra configuration
is needed for option -s
Jan Lentfer [Sat, 23 Jan 2010 20:46:00 +0000 (21:46 +0100)]
periodic/security: Add check for pkgsrc vulnerabilities
* adds /etc/periodic/security/670.pkgsrcaudit
* adds switches to /etc/default/periodic.conf
Recklessly-stolen-from: NetBSD
Suggested-by: Justin C. Sherrill
YONETANI Tomokazu [Fri, 22 Jan 2010 16:55:31 +0000 (01:55 +0900)]
Fix kernel build with IPFILTER but IPFILTER_LOG
YONETANI Tomokazu [Fri, 22 Jan 2010 16:53:48 +0000 (01:53 +0900)]
Fix kernel build for UP+KTR
Stathis Kamperis [Sat, 23 Jan 2010 11:29:53 +0000 (13:29 +0200)]
mqueues: Add sysctl for max message count in a queue.
A user could set mq_maxmsg (the maximal number of messages in a queue)
to a huge value on mq_open(O_CREAT) and later use up all kernel memory
by abusing mq_send(), resulting in a denial of service attack.
Add a sysctl'able limit which defaults to 16*mq_def_maxmsg.
Taken from NetBSD.
Matthew Dillon [Fri, 22 Jan 2010 17:35:24 +0000 (09:35 -0800)]
kernel - Fix bug in recent swap/paging work
* swap_pager_getpages() was improperly removing VM pages from their
VM queues, causing the pages to become untracked.
This resulted in a VM page leak over time as the system begins to
page to/from swap which eventually deadlocks the system.
* Cleanup #if conditionalized code from prior commits.
Matthew Dillon [Fri, 22 Jan 2010 05:09:51 +0000 (21:09 -0800)]
kernel - NFS - fix another B_CLUSTEROK / B_NEEDCOMMIT races
* nfs_flush_docommit() was not handling the case where B_NEEDCOMMIT
might get cleared by vfs_busy_pages() due to late detection of
a modified VM page.
This appears to be responsible for at least one fsx issue.
* Catch an edge case when clearing the PMAP modify bit in vfs_busy_pages().
* NFS no longer tries to cluster commit operations via the buffer cache's
cluster code. nfs_flush_docommit() will still do its own manual
clustering of commit ops. The problem with using B_CLUSTEROK is that
the cluster code will collect bufs together but vfs_busy_pages() might
have to clear B_NEEDCOMMIT when a late detection of a modified VM
pages occurs. This doesn't propagate back to the underlying bufs making
up the cluster.
This appears to be responsible for at least one fsx issue too.
Jan Lentfer [Thu, 21 Jan 2010 21:43:12 +0000 (22:43 +0100)]
named: conditionally copy files to chroot (rc-script)
* script snippet brought in from FreeBSD
Matthew Dillon [Thu, 21 Jan 2010 20:14:50 +0000 (12:14 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 21 Jan 2010 20:09:47 +0000 (12:09 -0800)]
md5 - Add subrange options
* Add -b <offset>, -e <offset> options to allow a sub-range
of a file to be MD5'd.
Submitted-by: "Mikhail T." <mi+thun@aldan.algebra.com>
Matthew Dillon [Thu, 21 Jan 2010 19:59:08 +0000 (11:59 -0800)]
libmd - Improve performance when doing a MD5 of a file via read().
* The code was using BUFSIZ, which is (ick) 1024 bytes. Increase the
file buffer to 8192 bytes.
Matthew Dillon [Thu, 21 Jan 2010 19:55:14 +0000 (11:55 -0800)]
kernel - Add burst reads back into swap_pager
* Burst reading from swap was disabled due to recent VM pager changes
which changes vm_pager_getpages() from specifying multiple-pages to
specifying just one-page.
* Add burst reading back into pretty much the only pager left (other
then devfs_pager and phys_pager which are special cases) which
doesn't use the buffer cache.
* The code may still be a bit unstable so it is diabled by default.
Add a new sysctl vm.swap_burst_read (defaults to off) which can
be used to enable burst reading from swap.
Matthew Dillon [Thu, 21 Jan 2010 19:40:29 +0000 (11:40 -0800)]
kernel - Add VM_ALLOC_QUICK feature to vm_page_alloc()
* This feature allocates a page like VM_ALLOC_NORMAL, retaining the same
free queue limits, but is not allowed to dig into the cache queue.
* Will be used by the new swap_pager_getpage() code.
Matthew Dillon [Thu, 21 Jan 2010 19:38:43 +0000 (11:38 -0800)]
kernel - reduces kern.maxvnodes on machines with less memory
* Increase the divisor a bit to compensate for the fact that HAMMER
eats significantly more kernel memory than UFS on a per-vnode basis.
This is to prevent the VM system from allocating all available memory
for required kernel structures on machines with small amounts of memory,
such as 128M, on vkernels, and on virtual machines configured with
fairly low amounts of memory.
Jan Lentfer [Thu, 21 Jan 2010 16:30:47 +0000 (17:30 +0100)]
BIND: Updated BIND to release 9.5.2-P2
Jan Lentfer [Thu, 21 Jan 2010 16:11:19 +0000 (17:11 +0100)]
BIND: update vendor tree to 9.5.2-P2
* This includes fixes for VU#418861 & VU#360341
Matthew Dillon [Wed, 20 Jan 2010 16:02:22 +0000 (08:02 -0800)]
kernel - ufs, ext2fs getpages/putpages cleanup
* Completely remove the original ffs_getpages/ffs_putpages code and
remove the vfs.ffs.getpages_uses_bufcache sysctl. UFS/FFS now
unconditionally use vop_stdgetpages and vop_stdputpages.
* ext2fs already unconditionally calls vnode_pager_generic_getpages().
Remove the shim and adjust ext2fs's .vop_getpages to point directly
to vop_stdgetpages().
Matthew Dillon [Wed, 20 Jan 2010 16:00:07 +0000 (08:00 -0800)]
kernel - Fix bug in recent defered-zap namecache code.
* The NCF_DEFEREDZAP code could get into a degenerate situation
where every name lookup ate tons of system cpu. Reset the
numdefered variable after cleaning defered-zap entries to fix.
Sascha Wildner [Wed, 20 Jan 2010 02:26:28 +0000 (03:26 +0100)]
syscalls.master: List all auto-generated files.
Matthew Dillon [Tue, 19 Jan 2010 22:45:46 +0000 (14:45 -0800)]
kernel - Add new bufcache/VM consolidated API, fsx fixes for NFS
* Add kern/vfs_vm.c with a new API for vtruncbuf() and vnode_pager_setsize()
called nvtruncbuf(), nvextendbuf(), and nvnode_pager_setsize(). This
API solves numerous problems with data coherency between the VM and
buffer cache subsystems.
Generally speaking what this API does is allow the VM pages backing the
buffer straddling EOF in a file to remain valid instead of invalidating
them. Take NFS for example with 32K buffers and, say, a 16385 byte
file. The NFS buffer cache buffer is backed by 8 x 4K VM pages but
the actual file only requires 5 x 4K pages. This API keeps all 8 VM
pages valid.
This API also handles zeroing out portions of the buffer after truncation
and zero-extending portions of the buffer after a file extension.
NFS has been migrated to the new API. HAMMER will soon follow. UFS and
EXT2FS are harder due to their far more complex buffer cache sizing
operations (due to their fragment vs full-sized block handling).
* Remodel the NFS client to use the new API. This allows NFS to consolidate
all truncation and extension operations into nfs_meta_setsize(), including
all code which previously had to deal with special buffer cache / VM
cases related to truncation and extension.
* Fix a bug in kern/vfs_bio.c where NFS buffers requiring the clearing
of B_NEEDCOMMIT failed to also clear B_CLUSTEROK, leading to occassional
attempts by NFS to issue RPCs larger than the NFS I/O block size (resulting
in a panic).
* NFS now uses vop_stdgetpages() and vop_stdputpages(). The NFS-specific
nfs_getpages() and nfs_putpages() has been removed. Remove a vinvalbuf()
in the nfs_bioread() code on remote-directory modification which was
deadlocking getpages. This needs more work.
* Simplify the local-vs-remote modification tests in NFS. This needs more
work. What was happening, generally, was that the larger number of
RPCs inflight allowed by the NFS client was creating too much confusion
in the attribute feedback in the RPC replies, causing the NFS client to
lose track of the file's actual size during heavy modifying operations
(aka fsx tests).
Sascha Wildner [Tue, 19 Jan 2010 04:38:26 +0000 (05:38 +0100)]
sched_rr_get_interval(2): Use copyout(9) for the interval argument.
This fixes a panic discovered when NULL was passed as interval.
Matthew Dillon [Mon, 18 Jan 2010 20:05:17 +0000 (12:05 -0800)]
kernel - Fix vkernel_trap
* vkernel_trap restores the trapframe for the original vkernel call to
vmspace_ctl(), but only the syscall trap code was actually setting
up the frame for a syscall-return.
The other calls to vkernel_trap() (signal, page-fault, other traps)
were not properly adjusting the frame for a syscall-return and it
is only pure luck that it didn't bite us until now.
* Add a per-platform cpu_vkernel_trap() which does the syscall-return
fixup at the end.
Reported-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
Matthew Dillon [Mon, 18 Jan 2010 17:57:51 +0000 (09:57 -0800)]
kernel - Fix pager bug in vm_fault and UFS and have UFS use vop_stdgetpages
* UFS must call vtruncbuf() before b*write()ing the buffer related to
a shortened file's truncation point. vtruncbuf() can invalidate pages
which are part of the buffer cache buffer. The b*write() revalidates
those pages. If we fail to revalidate the pages we can end up with a
buffer containing invalid pages with B_CACHE set.
* UFS was using its own getpages code in certain cases. Adjust it to
use vop_stdgetpages() in all cases by default.
vop_stdgetpages() uses UIO_NOCOPY VOP_READ()s to fill in missing data
and to perform read-ahead operations. It should properly deal with
partially valid and partially dirty pages as well as deal with file
holes.
* vm_fault can pass a valid page to the readrest: code if PG_RAM is set.
We cannot free this page if the underlying vnode contains a hole at
that location. Call vm_pager_get_page() unconditionally.
This fixes fsx failures for both NFS and UFS (when UFS is using
vop_stdgetpages()).
Sascha Wildner [Mon, 18 Jan 2010 13:57:44 +0000 (14:57 +0100)]
Sync zoneinfo database with tzdata2010a from elsie.
asia: 8.50 -> 8.51
* Revert 2009 start of DST in Dhaka (Bangladesh) to correct date.
* Make Dhaka fields consistent with others.
Sascha Wildner [Mon, 18 Jan 2010 09:01:43 +0000 (10:01 +0100)]
Raise WARNS in secure/ as high as possible and fix some resulting warnings.
Sascha Wildner [Mon, 18 Jan 2010 07:53:02 +0000 (08:53 +0100)]
syscall.9: Fix pathname.
Sascha Wildner [Mon, 18 Jan 2010 06:24:36 +0000 (07:24 +0100)]
Some manual page cleanup.
In *.9 manual pages, change references to files in /usr/src to be
relative to /usr/src.
Sascha Wildner [Mon, 18 Jan 2010 05:55:16 +0000 (06:55 +0100)]
Some devfs(5) related cleanup.
* Remove references to MAKEDEV from some manual pages.
* Remove sys/conf/majors file.
Matthew Dillon [Mon, 18 Jan 2010 01:53:47 +0000 (17:53 -0800)]
kernel - Finish implementing PG_RAM / pipelined mmap operation
* Finish implementing the PG_RAM read-ahead mark code. This code
allows the VM system to generate pipelining faults when reading a
memory mapped file sequentially.
This allows programs which scan files via mmap() to max-out the I/O system,
similar to read(). Before this change programs using mmap() could not get
better then ~70-80% disk utilization for sequential I/O.
This commit passes the sequential access flag through to the VOP_GETPAGES
code which then adjusts the sequential access heuristic in the ioflags
accordingly.
Matthew Dillon [Mon, 18 Jan 2010 01:27:50 +0000 (17:27 -0800)]
kernel - simplify vm pager ops, add pre-faulting for zero-fill pages.
* Remove the behind and ahead arguments to struct pagerops->pgo_getpages,
and pagerops->pgo_haspage.
Adjust pgo_getpages() to pgo_getpage(), change *_pager_getpages() to
*_pager_getpage(), etc. Add a sequential access flag to the call.
The VM system is no longer responsible for dealing with read-ahead on
pager ops. The individual pagers are now responsible.
The vnode pager now specifies the sequential access heuristic based on
the hint passed to it. HAMMER uses this hint to issue readaheads via
the buffer cache.
* Move, rename, and consolidate pmap_prefault(). Remove this function
from all platform sources and place it in vm/vm_fault.c. Add a
simple platform-specific pmap_prefault_ok() function to test particular
virtual addresses.
* The new prefault code is called vm_prefault(). Enhance the code to
also prefault and make writable (when it can) zero-fill pages.
The new zero-fill prefault feature improves buildworld times by
over 5% by greatly reducing the number of VM faults taken during
normal program operation. This particularly helps larger applications
and concurrent applications in SMP systems.
The code is conditionalized such that small applications (which do not
benefit much from prefaulting zero-fill) still run about as fast as
they did before.
* Fix an issue in vm_fault() where the vm_map was being unlocked before
the prefault code was called when it really needs to be unlocked
after the prefault code is called.
Matthew Dillon [Mon, 18 Jan 2010 01:23:53 +0000 (17:23 -0800)]
kernel - add spinlock to syscons console write path
* Add a spinlock in the console write path which is shared with
general console writes (CONS_LOCK is only used for kernel console
writes).
* Fixes MP races between kprintf() and general console writes which
can cause sc->videoio_in_progress to get out of sync, causing
vga consoles to stop generating output.
Matthew Dillon [Sun, 17 Jan 2010 21:34:28 +0000 (13:34 -0800)]
vmstat - Allow sub-second intervals to be specified.
* Allows e.g. vmstat 0.1 or even vmstat 1.5.
* Note that fields which are printed in per-second format are still
printed in per-second format. Sub-second rates may cause reduced
reliability for these fields.
Matthew Dillon [Sun, 17 Jan 2010 21:32:18 +0000 (13:32 -0800)]
kernel - do not wire user pages in sysctl
* sysctl processes have not assumed that user pages would be wired
for a long time.
* This also prevents sysctl from causing VM faults on the user memory
after returning due to wiring changes.
For example 'vmstat 1' no longer produces faults in the flt column
generated by vmstat itself on every iteration.
Jan Lentfer [Sun, 17 Jan 2010 13:21:39 +0000 (14:21 +0100)]
BIND: enable DNSSEC support for named and related tools by default.
* This adds -DOPENSSL and -lcrypto to effected Makefiles
* This patch also introduces NO_BIND_DNSSEC for make.conf
to disable build of DNSSEC with BIND.
Stathis Kamperis [Sun, 17 Jan 2010 06:44:05 +0000 (08:44 +0200)]
mqueues: Reduce diffs with NetBSD.
No functional change.
Stathis Kamperis [Sat, 16 Jan 2010 21:18:37 +0000 (23:18 +0200)]
mqueues: Fix deadlock situation.
tsleep() doesn't release the per-mqueue exclusive lockmgr lock before sleeping.
We need lksleep() instead.
Reported-by: swildner@
Matthew Dillon [Sat, 16 Jan 2010 20:46:50 +0000 (12:46 -0800)]
kernel - improve panic message on syscall MP mismatch
* Print the callp pointer so we can more easily discern which system
call has MP mismatches when the system asserts.
Matthew Dillon [Sat, 16 Jan 2010 20:42:04 +0000 (12:42 -0800)]
kernel - fix MP lock mismatch in sys_lwp_rtprio()
* sys_lwp_rtprio() was returning in certain cases without releasing
the MP lock.
Reported-by: Sascha Wildner <swildner@crater.dragonflybsd.org>
Peter Avalos [Sat, 16 Jan 2010 06:09:49 +0000 (20:09 -1000)]
Add the HPN patch for OpenSSH.
This provides dynamic windows and the ability to switch to a NONE
encryption cipher after authentication.
This does not include the multi-threaded AES-CTR cipher due to
unresolved problems causing it to hang.
For more details: http://www.psc.edu/networking/projects/hpn-ssh/
Requested-by: Michael Neumann <mneumann@ntecs.de>
Sascha Wildner [Sat, 16 Jan 2010 09:34:09 +0000 (10:34 +0100)]
openssh/auth2.c: Add a missing include (canohost.h).
canohost.h has the prototypes for get_canonical_hostname() and
get_remote_ipaddr(), which are used in auth2.c and which both return
const char * (64 bits on x86_64). Without the prototypes, int is
assumed (32 bits).
This caused sshd(8) to crash on x86_64 (i386 isn't affected due to the
char pointer and int having the same width there).
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1649>
Pointed-out-by: dillon
Sascha Wildner [Sat, 16 Jan 2010 02:32:26 +0000 (03:32 +0100)]
sys_linux_socketcall(): Add missing return() (fixes LINT).
Matthew Dillon [Sat, 16 Jan 2010 01:57:55 +0000 (17:57 -0800)]
kernel - fix sctp build (LINT)
* malloc_init() needs a pre-initialized ks_magic
* Remove unused variables.
Reported-by: Peter Avalos <pavalos@theshell.com>
Matthew Dillon [Sat, 16 Jan 2010 01:50:13 +0000 (17:50 -0800)]
kernel - add UP version for spin_trylock_wr()
* UP version is a degenerate case, used by kern_lock.o
Reported-by: Antonio Huete Jimenez <tuxillo@crater.dragonflybsd.org>
Matthew Dillon [Fri, 15 Jan 2010 23:20:41 +0000 (15:20 -0800)]
HAMMER VFS - Fix umount panic related to volume flush
* A volume undergoing I/O as-of the time of a umount can recurse within
hammer_io_release() due to improper ref-count handling.
* Properly reference and flus hthe volume during umount instead of
trying to call hammer_io_release() directly.
Reported-by: Jan Lentfer <Jan.Lentfer@web.de>
Antonio Huete Jimenez [Fri, 15 Jan 2010 23:10:03 +0000 (00:10 +0100)]
kmalloc(9) - Document M_INTWAIT flag.
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue925>
Reported-by: Michael Neumann <mneumann@ntecs.de>
Submitted-by: Matthew Dillon <dillon@apollo.backplane.com>
Stathis Kamperis [Fri, 15 Jan 2010 20:14:26 +0000 (22:14 +0200)]
mqueues: Partially sync with NetBSD.
This fixes the following critical issues:
* An invalid signal number passed to mq_notify() could crash the kernel
upon the signal delivery.
* mq_send() to a full queue could crash the kernel due to NULL pointer
dereference in timeout calculation.
* Likewise for mq_receive() from an empty queue.
Thanks to swildner@ for bringing this into my attention.
Matthew Dillon [Fri, 15 Jan 2010 19:19:29 +0000 (11:19 -0800)]
kernel - linux emulation - fix linux socketcall MP mismatch
* Fix get_mplock()/rel_mplock() mismatch
Reported-by: Rumko
Matthew Dillon [Fri, 15 Jan 2010 19:09:19 +0000 (11:09 -0800)]
kernel - Replace zalloc zones with kmalloc for PCBs
* Use kmalloc to allocate PCBs instead of zalloc. This removes over
100MB of KVA reservation, particularly from inp_tcp.
* Solves an issue with maxfiles where too much KVA was being reserved
by the network for PCBs.
* Replace all SCTP zalloc zones with kmalloc.
Reported-bu: Rumko, Peter Avalos <pavalos@theshell.com>
Antonio Huete Jimenez [Fri, 15 Jan 2010 12:27:57 +0000 (13:27 +0100)]
hammer - A small set of adjustments to the info directive.
* Rename some field's name.
* Add percent to space details.
* Fix line lenght to match style(9) and other minor changes.