dragonfly.git
14 years agokernel - Introduce lightweight buffers
Samuel J. Greear [Tue, 9 Mar 2010 09:24:55 +0000 (02:24 -0700)]
kernel - Introduce lightweight buffers

 * Summary:
   The lightweight buffer (lwbuf) subsystem is effectively a reimplementation
   of the sfbuf (sendfile buffers) implementation. It was designed to be
   lighter weight than the sfbuf implementation when possible, on x86_64
   we use the DMAP and the implementation is -very- simple. It was also
   designed to be more SMP friendly.

 * Replace all consumption of sfbuf with lwbuf

 * Refactor sfbuf to act as an external refcount mechanism for sendfile(2),
   this will probably go away eventually as well.

14 years agowbsio(4): be less verbose if the device doesn't look like a wbsio device
Constantine A. Murenin [Thu, 18 Mar 2010 22:19:56 +0000 (18:19 -0400)]
wbsio(4): be less verbose if the device doesn't look like a wbsio device

14 years agowbsio(4): be more verbose for unsupported devices if loaded as a module or if bootverbose
Constantine A. Murenin [Thu, 18 Mar 2010 21:57:39 +0000 (17:57 -0400)]
wbsio(4): be more verbose for unsupported devices if loaded as a module or if bootverbose

14 years agowbsio(4) && lm(4): add support for `kldload lm.ko wbsio.ko`
Constantine A. Murenin [Thu, 18 Mar 2010 19:34:54 +0000 (15:34 -0400)]
wbsio(4) && lm(4): add support for `kldload lm.ko wbsio.ko`

14 years agokernel - devfs - Fix memory leak in devfs_destroy_device_node()
Matthew Dillon [Thu, 18 Mar 2010 18:46:16 +0000 (11:46 -0700)]
kernel - devfs - Fix memory leak in devfs_destroy_device_node()

* M_TEMP is used by devfs to allocate temporary PATH_MAX buffers

* devfs had a memory leak in a particular failure case, fix it.
  This is likely the reported problem.

Reported-by: John Marino <john@marino.st>
14 years agoaps(4): make the aps module, aps.ko, work as well as the in-kernel device
Constantine A. Murenin [Thu, 18 Mar 2010 09:03:11 +0000 (05:03 -0400)]
aps(4): make the aps module, aps.ko, work as well as the in-kernel device

14 years agowbsio(4): support W83667HG (0xa5); its hw mon is already supported by lm(4) as W83627...
Constantine A. Murenin [Mon, 15 Mar 2010 17:43:31 +0000 (13:43 -0400)]
wbsio(4): support W83667HG (0xa5); its hw mon is already supported by lm(4) as W83627DHG (0xc1)

14 years agokern_{get,set}sockopt - invalid value check
Alex Hornung [Wed, 17 Mar 2010 14:20:15 +0000 (14:20 +0000)]
kern_{get,set}sockopt - invalid value check

* Check for sopt_val != NULL && sopt_valsize == 0 and return EINVAL in
  this case, or else an assert will be triggered and the kernel will
  panic.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1696

14 years agoHAMMER VFS - Cleanup recovery kprintfs a bit
Matthew Dillon [Wed, 17 Mar 2010 03:52:20 +0000 (20:52 -0700)]
HAMMER VFS - Cleanup recovery kprintfs a bit

* Minor formatting cleanups.

14 years agovmstat - update for changes in nch structure
Matthew Dillon [Wed, 17 Mar 2010 02:52:13 +0000 (19:52 -0700)]
vmstat - update for changes in nch structure

* Adjust for changes in the namei / path lookup statistics structure

14 years agolinux emu - fix some signalling mess
Alex Hornung [Tue, 16 Mar 2010 22:22:46 +0000 (22:22 +0000)]
linux emu - fix some signalling mess

* This fixes sigaction in the linux emu, which broke times03 and
  possibly also part of java (and who knows, maybe flash?)

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 16 Mar 2010 21:30:53 +0000 (14:30 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agokernel - Fix kernel memory leak in devfs disk_probe()
Matthew Dillon [Tue, 16 Mar 2010 21:29:14 +0000 (14:29 -0700)]
kernel - Fix kernel memory leak in devfs disk_probe()

* kfree() the old slices structure after installing a new one.

* Do a minor refactoring of dsgone().

* Possibly fixes a kernel memory leak generated by kde's CD probing.
Reported-by: Pierre Abbat <phma@phma.optus.nu>
14 years agolinux emu - fix exit status on exit_group
Alex Hornung [Tue, 16 Mar 2010 21:24:07 +0000 (21:24 +0000)]
linux emu - fix exit status on exit_group

* Previously, the exit status was set incorrectly; the exit signal was
  being set instead with the supposed exit status.

14 years agosystat - break out read and write I/O activity, change namecache statistics
Matthew Dillon [Tue, 16 Mar 2010 19:17:45 +0000 (12:17 -0700)]
systat - break out read and write I/O activity, change namecache statistics

* Add additional rows to break the I/O statistics into separate read and
  write stats (something I've always wanted systat to do).

* Rework the namecache statistics.  Primarily show whole path lookups
  stats instead of component lookups, and then also print the average
  number of components.

14 years agokernel - rework struct nchstats for systat
Matthew Dillon [Tue, 16 Mar 2010 19:15:54 +0000 (12:15 -0700)]
kernel - rework struct nchstats for systat

* Remove ncs_long, ncs_pass2 and ncs_2passes and replace with
  ncs_longhits, ncs_longmiss, and ncs_unused (so the structure
  size does not change).

  The new longhits/longmiss statistics are for whole path
  lookups.

14 years agolibdevstat - Add compute_stats_read() and compute_stats_write()
Matthew Dillon [Tue, 16 Mar 2010 19:14:02 +0000 (12:14 -0700)]
libdevstat - Add compute_stats_read() and compute_stats_write()

* Add versions of compute_stats() which separate out the read and
  write activity.

14 years agoHAMMER VFS - Fix an edge case in hammer_inode_waitreclaims()
Matthew Dillon [Tue, 16 Mar 2010 17:39:01 +0000 (10:39 -0700)]
HAMMER VFS - Fix an edge case in hammer_inode_waitreclaims()

* Detached inodes can build up in the flusher, causing iqueued/reclaiming
  to increase.  hammer_inode_waitreclaims() is designed to slow down
  the processes responsible (typically a rm -rf) to prevent the backlog
  from blowing out kernel memory.

* hammer_inode_waitreclaims() had a bug where a new pid entry was not
  being placed in the hash table such that it would be properly found
  by the chaining.  Fix this case.

* This fixes an issue where a simultanious rm -rf and (typically) two or
  more directory iterations via ls or find over hundreds of thousands or
  millions of files could cause the number of detached inodes to increase
  in an unbounded fashion.

14 years agopmap: Warning -> Debug
Aggelos Economopoulos [Tue, 16 Mar 2010 13:13:25 +0000 (15:13 +0200)]
pmap: Warning -> Debug

This message does not concern the system administrator,
try not to get them worried for no reason.

14 years agolinux emu - fix bug in futex
Alex Hornung [Tue, 16 Mar 2010 12:24:45 +0000 (12:24 +0000)]
linux emu - fix bug in futex

* when resetting the fault handler in futex_orl - futex_tail, reset ecx
  to the right value.

14 years agokern_synch - unbreak UP build
Alex Hornung [Tue, 16 Mar 2010 12:46:37 +0000 (12:46 +0000)]
kern_synch - unbreak UP build

* recent work on allowing volatile idents for tsleep and wakeup broke UP
  build.

14 years agolinux emu - fix MP bug related to TLS
Alex Hornung [Tue, 16 Mar 2010 11:29:21 +0000 (11:29 +0000)]
linux emu - fix MP bug related to TLS

* all TLS functions were passing out or assuming the wrong value to load
  into gs. As a matter of fact, this should be the same for SMP and UP,
  but just in case keep the old code in #if 0's.

14 years agolinprocfs - fix multi-CPU stat & cpuinfo
Alex Hornung [Tue, 16 Mar 2010 09:02:47 +0000 (09:02 +0000)]
linprocfs - fix multi-CPU stat & cpuinfo

* Add multiprocessor support to /proc/stat and /proc/cpuinfo, as the
  sysconf() function uses these to find the total number of CPUs in the
  system.

14 years agobuild - Fix ordering to avoid -j race
Matthew Dillon [Tue, 16 Mar 2010 08:57:28 +0000 (01:57 -0700)]
build - Fix ordering to avoid -j  race

* The mkdir -p must complete prior to any source file copies.

14 years agokernel - change tsleep related idents to const volatile void *
Matthew Dillon [Mon, 15 Mar 2010 20:12:23 +0000 (13:12 -0700)]
kernel - change tsleep related idents to const volatile void *

* There's no reason why pointers to const or volatiles can't be passed
  as the ident, and HAMMER does that now in some cases, so adjust the
  prototypes for *sleep() and *wakeup() to accomodate them.

* Also make thread->td_wchan const volatile void *

14 years agolinux emu - iron out bugs
Alex Hornung [Mon, 15 Mar 2010 19:08:42 +0000 (19:08 +0000)]
linux emu - iron out bugs

* mmap: make sure that PROT_READ is not set if PROT_NONE is specified.

* sysinfo: Updata sysinfo to the new structure used since linux
  2.3.something.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 15 Mar 2010 17:50:16 +0000 (10:50 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoHAMMER VFS - Hack cursor iterator when locked cursor moved to parent
Matthew Dillon [Mon, 15 Mar 2010 17:49:03 +0000 (10:49 -0700)]
HAMMER VFS - Hack cursor iterator when locked cursor moved to parent

* A cursor is also moved to its parent normally when deleting the last
  element in a node and that node is then destroyed.

Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
14 years agoHAMMER VFS - Major retooling of the refcount mechanics, and fix a deadlock
Matthew Dillon [Mon, 15 Mar 2010 09:07:23 +0000 (02:07 -0700)]
HAMMER VFS - Major retooling of the refcount mechanics, and fix a deadlock

* Add an interlock to hammer_lock->refs which is independent of
  hammer_lock->lockval.

* Retool the refcount mechanics to integrate the interlock on 0->1 and
  1->0 transitions.

  In addition implement a check bit to deal with serialization races
  between threads which forces all threads to interlock.  This deals
  with the case where one thread bumps the refcount (lock->refs) but
  is unable to immediateliy acquire the interlock.  Other threads doing
  the same thing will race and lock->refs will be bumped far higher
  than 1.  The check bit is set on the 0->1 transition and enforces
  all threads to serialize until one (usually the first to acquire the
  lock) is able to dispose of the check condition.

  The transition interlocks are used to do I/O loading and validation
  on the 0->N transition and I/O unloading and invalidation on the 1->0
  transition.

* The new integrated mechanics also simplify hammer_io's handling of
  B_LOCKED slightly and properly interlocks changes in disposition for
  the related buffer cache buffer against refcount transitions.

* The new integrated refcount/interlock is also more optimal as the
  combined operation can be done in a single atomic_cmpset_int() call,
  and fully MPSAFE.  Even though other major portions of HAMMER are not
  yet MPSAFE getting this particular bit dealt with will ease MP work
  later on.

* Retool the volume, buffer, and node referencing code to use the new
  mechanics.  This fixes a deadlock.  These routines were previously
  acquiring an exclusive lock instead of an interlock.  The exclusive
  lock could combine with shared locks held by the same thread to create
  a deadlock situation against other threads.

  Use of the interlock fixes this particular deadlock.

Reported-by: Francois Tigeot <ftigeot@wolfpond.org> (deadlock report)
14 years agofetch.9: Minor fixes.
Sascha Wildner [Sun, 14 Mar 2010 12:48:50 +0000 (13:48 +0100)]
fetch.9: Minor fixes.

14 years agofetch.9 - document casuword
Alex Hornung [Sun, 14 Mar 2010 09:32:00 +0000 (09:32 +0000)]
fetch.9 - document casuword

14 years agonlookup.9 - document nlookup_init_root
Alex Hornung [Sun, 14 Mar 2010 09:06:30 +0000 (09:06 +0000)]
nlookup.9 - document nlookup_init_root

14 years agovfs_synth - rewrite
Alex Hornung [Sun, 14 Mar 2010 08:57:36 +0000 (08:57 +0000)]
vfs_synth - rewrite

* Rewrite the whole vfs_synth mess to be compatible with devfs. Now we
  create a synthetic mountpoint and mount devfs on it. We then just
  nlookup() whatever device we need on that mountpoint.

* This also fixes vinum rootmount. To use vinum as a root,
  vfs.root.mountfrom in /boot/loader.conf has to be set to
  "<fs>:vinum/vinumroot" where <fs> can be ufs or hammer.

Reported-by: Rumko, tuxillo
Dragonfly-bug: http://bugs.dragonflybsd.org/issue1565

14 years agonlookup - introduce nlookup_init_root
Alex Hornung [Sun, 14 Mar 2010 08:27:32 +0000 (08:27 +0000)]
nlookup - introduce nlookup_init_root

* nlookup_init_root is similar to nlookup_init_raw, but does not assume
  rootnch is set already, but rather has one more parameter which
  specifies the root nch.

14 years agohammer.8: Fix list.
Sascha Wildner [Sun, 14 Mar 2010 12:11:40 +0000 (13:11 +0100)]
hammer.8: Fix list.

14 years agoAdjust some more to the recent groff 1.20.1 import.
Sascha Wildner [Sun, 14 Mar 2010 11:55:11 +0000 (12:55 +0100)]
Adjust some more to the recent groff 1.20.1 import.

* Dx is now a built in macro, so remove our local definition. But the
  version supplied with groff still doesn't work correctly due to a
  missing register declaration in doc-common. Fix that locally for now
  (patch sent upstream).

* Sync various definitions (standards, operating systems) with doc-common
  and doc-syms, i.e. remove our local definitions where they are part of
  groff now.

14 years agoHAMMER VFS - Hack cursor iterator when unlocked cursor moved to parent
Matthew Dillon [Sun, 14 Mar 2010 05:16:38 +0000 (21:16 -0800)]
HAMMER VFS - Hack cursor iterator when unlocked cursor moved to parent

* It is possible to reverse-index a cursor while it is unlocked due to
  a node deletion moving cursors on that node to the parent, and a
  subsequent insertion then inserting new elements between the cursor's
  current position and its expected iteration range.

* Detect the case with a new flag (hack!) HAMMER_CURSOR_ITERATE_CHECK
  and just iterate past the elements outside the iteration range in
  this case.

Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
14 years agomdoc: Add NetBSD 6.0 (used in wbsio.4).
Sascha Wildner [Sun, 14 Mar 2010 01:32:47 +0000 (02:32 +0100)]
mdoc: Add NetBSD 6.0 (used in wbsio.4).

14 years agoActually hook powernow.4 into the build.
Sascha Wildner [Sun, 14 Mar 2010 01:31:13 +0000 (02:31 +0100)]
Actually hook powernow.4 into the build.

14 years agolinprocfs - Introduce /proc/mounts
Alex Hornung [Sat, 13 Mar 2010 15:39:37 +0000 (15:39 +0000)]
linprocfs - Introduce /proc/mounts

* Introudce the /proc/mounts entry to satisfy some installers, and df.

* NOTE: if you intend to chroot into the linux base, you'll have to
  change your /compat/linux/etc/mtab symlink to point to /proc/mounts
  instead. Also note that the paths are not relative to the linux
  chroot.

Reported-by: Sascha Wildner
14 years agoFix LINT build.
Sascha Wildner [Sat, 13 Mar 2010 12:58:36 +0000 (13:58 +0100)]
Fix LINT build.

14 years agolinux emulation - Major update
Alex Hornung [Fri, 12 Mar 2010 23:08:40 +0000 (23:08 +0000)]
linux emulation - Major update

* Major update to all components of the linux emulation layer
  (linuxulator) and linprocfs.

* Many old system calls have been overhauled and new ones added.

* Tested with java 1.6.18, apache tomcat 6, opera, Acrobat Reader, ...

* NOTE: Flash doesn't work yet, and I haven't been able to figure out
  why. I'll continue my work on the linuxulator part time now, and
  hopefully eventually fix the issue(s).
  Some parts of this have been taken from FreeBSD and NetBSD.
  Overall the new stuff isn't as well organized as it should be; most of
  the new defines are in linux.h as I didn't bother splitting it up into
  independent headers.
  Once we plan on porting the linuxulator to amd64, this has to be taken
  care of, so especially machine independent bits are broken out of the
  machine dependent sys/emulation/linux/i386.

14 years agoprocfs - Use newly introduced textnch
Alex Hornung [Fri, 12 Mar 2010 23:07:27 +0000 (23:07 +0000)]
procfs - Use newly introduced textnch

* Use the newly introduced p_textnch instead of p_textvp to find the
  path to the .text file for each proc entry in /proc.

14 years agolinux emu - peripheral changes
Alex Hornung [Fri, 12 Mar 2010 22:59:30 +0000 (22:59 +0000)]
linux emu - peripheral changes

* These are peripheral changes to prepare for the import of the updated
  linuxulator:

* hooks (eventhandler) for process creation and process exit.

* splitting up of sys_kevent into sys_kevent + kern_kevent, including
  generic copyiin and copyout functions.
  Obtained-from: FreeBSD

* adding a p_textnch to store the namecache handle for the .text file.

* minor changes to sysv_sem and sysv_shm to support linux-specific
  magic.

* bring in casuword (compare and set userland word)
  Obtained-from: FreeBSD

* add a hook for userret from syscall2
Inspired-by: NetBSD
14 years agokernel - AHCI - enable AHCI device initiated power management
Matthew Dillon [Fri, 12 Mar 2010 23:07:58 +0000 (15:07 -0800)]
kernel - AHCI - enable AHCI device initiated power management

* Add hw.ahci sysctls to allow the power management state to be set and
  monitored.

* Issue device features command when aggressive power management is
  enabled to turn on device-initiated power management, and turn it off
  when power management is set to none.

* Currently does not try do power management for devices behind a
  PM.

Submitted-by: Johannes Hofmann <johannes.hofmann@gmx.de>
14 years agofstat - Fix path construction for "wd".
Matthew Dillon [Fri, 12 Mar 2010 22:43:44 +0000 (14:43 -0800)]
fstat - Fix path construction for "wd".

* Fix path construction for "wd", the wrong mount pointer was being used.

Reported-by: Alex Hornung <ahornung@gmail.com>
14 years agokernel - fix procfs vm_map scan.
Matthew Dillon [Wed, 10 Mar 2010 23:56:09 +0000 (15:56 -0800)]
kernel - fix procfs vm_map scan.

* procfs was holding a vm_map lock during a uiomove, which can result
  in a recursive lock panic on the vm_map.

* since we must now unlock the map during the uiomove use a trick with
  vm_map->hint to detect if the current entry has been ripped out from
  under us and issue a lookup to reacquire our position in the scan.

Reported-by: "Alex Hornung" <ahornung@gmail.com>
14 years agoSync zoneinfo database with tzdata2010e from elsie.
Sascha Wildner [Tue, 9 Mar 2010 08:28:58 +0000 (09:28 +0100)]
Sync zoneinfo database with tzdata2010e from elsie.

asia:           8.54 -> 8.55

Fixes a bug with the rules for Bangladesh introduced in 8.54.

14 years agokernel - Restore ability to thaw checkpoints
Samuel J. Greear [Mon, 8 Mar 2010 18:27:23 +0000 (11:27 -0700)]
kernel - Restore ability to thaw checkpoints

  * Catch up with changes to imgact_elf.c

14 years agoSync zoneinfo database with tzdata2010d from elsie.
Sascha Wildner [Mon, 8 Mar 2010 18:40:55 +0000 (19:40 +0100)]
Sync zoneinfo database with tzdata2010d from elsie.

asia:           8.51 -> 8.54
australasia:    8.15 -> 8.16
southamerica:   8.41 -> 8.43

* Adjust start and end of Bangladesh DST.

* Fiji ends DST about a month early.

* Samoa DST postponed to 2010.

* Chile exceptionally extends DST to April 3 this year due to the earthquake.

14 years agowbsio(4): don't reuse a child that has already been attached
Constantine A. Murenin [Mon, 8 Mar 2010 12:34:05 +0000 (07:34 -0500)]
wbsio(4): don't reuse a child that has already been attached

14 years agowbsio(4): convert to Newbus and DragonFly -- welcome wbsio(4)!
Constantine A. Murenin [Mon, 8 Mar 2010 10:26:58 +0000 (05:26 -0500)]
wbsio(4): convert to Newbus and DragonFly -- welcome wbsio(4)!

* New wbsio(4) driver for Winbond Super I/O attachment of lm(4) on any port.

14 years agowbsio(4): raw wbsio.c#rev1.1 and wbsio.4#rev1.1 from NetBSD
Constantine A. Murenin [Sun, 21 Feb 2010 09:36:20 +0000 (04:36 -0500)]
wbsio(4): raw wbsio.c#rev1.1 and wbsio.4#rev1.1 from NetBSD

14 years agoRemove <sys/msfbuf.h> per 'make upgrade'.
Sascha Wildner [Mon, 8 Mar 2010 10:07:46 +0000 (11:07 +0100)]
Remove <sys/msfbuf.h> per 'make upgrade'.

14 years agoRemove WARNS?=6 from two Makefiles where it is not needed.
Sascha Wildner [Sun, 7 Mar 2010 08:04:09 +0000 (09:04 +0100)]
Remove WARNS?=6 from two Makefiles where it is not needed.

WARNS is 6 by default in bin/, games/, sbin/, usr.bin/ and usr.sbin/
(per Makefile.inc) and only needs to be specified explicitly there
for utilities which need WARNS < 6.

14 years agomptable - raise WARNS to 6
YONETANI Tomokazu [Sun, 7 Mar 2010 04:24:45 +0000 (13:24 +0900)]
mptable - raise WARNS to 6

14 years agomptable - factor out the MP_SIG lookup code
YONETANI Tomokazu [Sun, 7 Mar 2010 03:47:49 +0000 (12:47 +0900)]
mptable - factor out the MP_SIG lookup code

14 years agomptable - prepare to raise WARNS
YONETANI Tomokazu [Sun, 7 Mar 2010 04:46:08 +0000 (13:46 +0900)]
mptable - prepare to raise WARNS

- do not declare extern optreset, which is not used.
- constify lookup tables
- fix printf format strings

14 years agomptable - use fixed-size integers in the structures; fixes x86_64
YONETANI Tomokazu [Sun, 7 Mar 2010 03:08:24 +0000 (12:08 +0900)]
mptable - use fixed-size integers in the structures; fixes x86_64

14 years agomq_receive.2: Add missing space.
Sascha Wildner [Sat, 6 Mar 2010 14:24:03 +0000 (15:24 +0100)]
mq_receive.2: Add missing space.

14 years agotaskqueue.9: Do some mdoc cleanup & add missing MLINKS.
Sascha Wildner [Sat, 6 Mar 2010 09:03:44 +0000 (10:03 +0100)]
taskqueue.9: Do some mdoc cleanup & add missing MLINKS.

14 years agokernel - Remove msf buffer code
Samuel J. Greear [Fri, 5 Mar 2010 18:07:43 +0000 (11:07 -0700)]
kernel - Remove msf buffer code

* MSF Buffers are no longer consumed by any kernel subsystem,
  remove them and free up 32MB of KVA

14 years agopci_alloc_msix: Fail if no MSI-X vectors available
Michael Neumann [Fri, 5 Mar 2010 23:20:12 +0000 (00:20 +0100)]
pci_alloc_msix: Fail if no MSI-X vectors available

Otherwise bootverbose could lead to a kernel crash.
This commit also lets the igb driver correctly fall-back
to non MSI-X code. MSI-X is currently not supported by
DragonFly.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Michael Neumann [Fri, 5 Mar 2010 22:30:03 +0000 (23:30 +0100)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoUnbreak buildkernel / mxge(4)
Michael Neumann [Fri, 5 Mar 2010 22:26:48 +0000 (23:26 +0100)]
Unbreak buildkernel / mxge(4)

Partially revert commit 0a702a628e2af43ec0cb538349278b4d98993572.

14 years agofortune(6): fix more typos, whitespace, remove dupes
Ulrich Spörlein [Sat, 6 Feb 2010 10:19:26 +0000 (11:19 +0100)]
fortune(6): fix more typos, whitespace, remove dupes

Fixes are courtesy of FreeBSD.

14 years agoMerge branch 'master' of git://git.dragonflybsd.org/dragonfly
Michael Neumann [Fri, 5 Mar 2010 18:09:41 +0000 (19:09 +0100)]
Merge branch 'master' of git://git.dragonflybsd.org/dragonfly

14 years agoe1000 - Make igb driver compile on DragonFly
Michael Neumann [Fri, 5 Mar 2010 18:07:53 +0000 (19:07 +0100)]
e1000 - Make igb driver compile on DragonFly

The driver itself does not work. The devices successfully
attach, but when trying to set an IP address it hangs.
More work needs to go into this driver.

14 years agoHAMMER VFS - Ensure sufficient free memory is available before large allocation
Matthew Dillon [Fri, 5 Mar 2010 00:06:53 +0000 (16:06 -0800)]
HAMMER VFS - Ensure sufficient free memory is available before large allocation

* The HAMMER rebalancing code can be a heavy user of kernel memory when
  collecting B-Tree nodes to rebalance.

  Call the new vm_wait_nominal() function before allocating said memory
  in an attempt to avoid VM/VFS deadlocks when memory is low.

Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
14 years agokernel - vm - add vm_wait_nominal()
Matthew Dillon [Fri, 5 Mar 2010 00:05:38 +0000 (16:05 -0800)]
kernel - vm - add vm_wait_nominal()

* Add vm_wait_nominal(), a function which activates the pageout daemon
  if necessary and waits for sufficient memory to become free for
  a kernel heavy user.

14 years agocompilers.conf.5: Clarify some more.
Sascha Wildner [Thu, 4 Mar 2010 17:25:32 +0000 (18:25 +0100)]
compilers.conf.5: Clarify some more.

14 years agoAdd device sg to LINT.
Sascha Wildner [Thu, 4 Mar 2010 07:47:10 +0000 (08:47 +0100)]
Add device sg to LINT.

14 years agoFix typos in manual pages and user visible messages.
Sascha Wildner [Thu, 4 Mar 2010 06:00:42 +0000 (07:00 +0100)]
Fix typos in manual pages and user visible messages.

14 years agoSort the SEE ALSO sections in some manual pages.
Sascha Wildner [Thu, 4 Mar 2010 05:01:02 +0000 (06:01 +0100)]
Sort the SEE ALSO sections in some manual pages.

14 years agokernel - pmap (i386) - Reduce kmem use for foreign pmap mapping
Matthew Dillon [Thu, 4 Mar 2010 01:53:37 +0000 (17:53 -0800)]
kernel - pmap (i386) - Reduce kmem use for foreign pmap mapping

* We've been having problems running out of KVA on i386 systems due to
  numerous reasons.  KVA use by the kernel is just too tight.

* Reserve space for foreign pmap page table mappings on a cpu-by-cpu basis
  instead of for SMP_MAXCPU.  This reduces KVM use from 68MB to (ncpu*4MB).
  Use the APT entry for cpu0 and use kmem_alloc_nofault() for the APs.

  This frees up 52MB of KVA which doesn't sound like a lot but actually
  is.

* Add an alignment argument to kmem_alloc_nofault() and vm_map_find().

* vm_map_findspace() already had an alignment argument, but adjust the
  value passed to be at least PAGE_SIZE (this has no operational effect
  but is more correct).

14 years agoVN - Remove use of IO_DIRECT, Improve lock performance for reads
Matthew Dillon [Wed, 3 Mar 2010 07:15:27 +0000 (23:15 -0800)]
VN - Remove use of IO_DIRECT, Improve lock performance for reads

* Remove the use of IO_DIRECT.  This just doesn't work very well,
  particularly when the device backing the VN has a different logical
  block size than the device using VN.

  This will result in heavier use of the buffer cache and more
  (temporarily) duplicated data, but also has much better performance.

* Use LK_SHARED for VOP_READ()s instead of LK_EXCLUSIVE, which allows
  concurrent reads to be issued.

Reported-by: Vincent Stemen <vince.dragonfly@hightek.org>
14 years agoHAMMER VFS - Do a better job with IO_DIRECT
Matthew Dillon [Wed, 3 Mar 2010 06:50:10 +0000 (22:50 -0800)]
HAMMER VFS - Do a better job with IO_DIRECT

* IO_DIRECT is rather nasty, only actually honor it if the write() operation
  fits the buffer.

Reported-by: Vincent Stemen <vince.dragonfly@hightek.org>
14 years agoHAMMER VFS - Fix assertion in hammer_btree_mirror_propagate()
Matthew Dillon [Wed, 3 Mar 2010 01:29:14 +0000 (17:29 -0800)]
HAMMER VFS - Fix assertion in hammer_btree_mirror_propagate()

* hammer_btree_mirror_propagate() asserts it is on an internal node but
  recovery operations can now place us on a leaf, so just loop if we
  are on a leaf and remove the assertion.

14 years agocpdup - Add -VV to ignore mtime
Matthew Dillon [Tue, 2 Mar 2010 23:58:07 +0000 (15:58 -0800)]
cpdup - Add -VV to ignore mtime

* The cpdup -V option verifies the contents of the files even if the
  mtime is the same, but also (currently) recopies the file without
  bothering to verify the contents if the mtime is different, even if
  the contents is the same.

* Add an extension, -VV, which verifies the contents of the file and
  ignores mtime entirely.  A copy is only made if the ownerchip,
  flags, modes, or content differs.

14 years agoHAMMER VFS - Correct seriuos bug in hammer rebalancing code
Matthew Dillon [Tue, 2 Mar 2010 22:36:40 +0000 (14:36 -0800)]
HAMMER VFS - Correct seriuos bug in hammer rebalancing code

* Correct a serious bug in the hammer rebalancing code which can cause
  incremental mirrors to lose track of records, resulting in missing records
  on the slave (missing files, missing directory entries, or files
  which improperly contain data holes).

  The rebalancing code needs to update the mirror_tid chain when moving
  elements from one node to another.  It updated the parent node but failed
  to update the internal element linkage pointing to the child.

  This can cause incremental mirroring operations to fail to copy some B-Tree
  records.

* Correct a possible issue between the rebalancing code and B-Tree
  iterations during mirror-write operations.

  When the rebalancer moves an element from one child node to another and
  a cursor exists which is pointing at the parent internal node, the
  cursor will now be mispositioned because elements which were to the
  right of the cursor are now to the left of the cursor.

  Adjust hammer_cursor_moved_element() to properly move the cursor and
  print a debug message to the console so the code path can be tested.

* These bugs are serious but also very rare.  There is a good chance that
  your slaves are just fine, but we recommend validating their contents
  anyway.

* PROCEDURE FOR FIXING BROKEN SLAVES:  With a little help from the sysop
  these problems are self-correcting with the new kernel code in place.

  First make sure both the master and slave are running a kernel with
  the mirroring fix.

  Second, verify the slave matches the master (taking into account
  changes being made to live files).  Probably the easiest way to do
  this is as follows (make sure you push into the softlink, not cpdup
  the softlink itself):

cpdup -v -V /pfs/master/. /pfs/slave/.

  This should get you a list of missing files and directories.  For
  each missing file or directory do a chmod, chown, or chflags on the
  master, then change it back.  This will propagate the updated inode
  to the slave So for example:

chflags nodump file
chflags dump file

  If file data is corrupt on the mirroring slave you need to recopy the
  file on the master, which can be done with dd conv=notrunc:

dd if=file of=file bs=32k conv=notrunc

  These actions will cause the master to re-mirror the related files and
  data to the slave.

Reported-by: Stathis Kamperis <beket@crater.dragonflybsd.org>
14 years agoHAMMER Utility - Enhance the mirroring and show code
Matthew Dillon [Tue, 2 Mar 2010 22:34:40 +0000 (14:34 -0800)]
HAMMER Utility - Enhance the mirroring and show code

* mirror-read will now run the histogram just like mirror-stream does.

* improve versbose output when doing a mirror-read or mirror-stream.

* hammer show now validates the mirror_tid in the B-Tree and produces
  a 'B' indication with the 'M' flag if it finds a bad mirror_tid
  chaining.

14 years agolibc/stdtime: Sync localtime.c with tzcode2010c from elsie.
Sascha Wildner [Tue, 2 Mar 2010 15:42:36 +0000 (16:42 +0100)]
libc/stdtime: Sync localtime.c with tzcode2010c from elsie.

More core dump avoidance work.

14 years agoSync zoneinfo database with tzdata2010c from elsie.
Sascha Wildner [Tue, 2 Mar 2010 15:41:18 +0000 (16:41 +0100)]
Sync zoneinfo database with tzdata2010c from elsie.

southamerica:   8.40 -> 8.41

Paraguay changes DST schedule, starting in April now.

14 years agoRegenerate the pciconf(8) database
Sascha Wildner [Tue, 2 Mar 2010 15:09:28 +0000 (16:09 +0100)]
Regenerate the pciconf(8) database

...from the following files:

Hart:    Jan 22, 2008 (version 671)
Boemler: Mar  1, 2010
Mares:   Mar  1, 2010

14 years agolibc/locale: Use _getprogname().
Sascha Wildner [Tue, 2 Mar 2010 11:16:02 +0000 (12:16 +0100)]
libc/locale: Use _getprogname().

14 years agolibc/citrus: Forward declare some structs to fix some warnings.
Sascha Wildner [Tue, 2 Mar 2010 11:07:47 +0000 (12:07 +0100)]
libc/citrus: Forward declare some structs to fix some warnings.

14 years agotalk - unbreak for unix98 ptys
Alex Hornung [Tue, 2 Mar 2010 07:45:20 +0000 (07:45 +0000)]
talk - unbreak for unix98 ptys

* Unbreak talk, which relied on seeing old-style ptys. When I introduced
  the unix98 ptys.

* This assumption would not work anymore, since the
  last slash is not the slash after /dev, but rather the one after
  /dev/pts. Later opening 0 instead of pts/0 would give an error.

Reported-by: Peter Avalos, Matt Dillon
14 years agokernel - cleanup some unnecessary casts
Matthew Dillon [Tue, 2 Mar 2010 00:12:26 +0000 (16:12 -0800)]
kernel - cleanup some unnecessary casts

* Adjust disk_msg_core() and friends to not make unnecessasry casts
  when playing with LWKT messages.

* In disk_msg_send_sync() call lwkt_waitmsg() instead of lwkt_waitport(),
  which cleans up the code flow a bit.

14 years agokernel - Move grow_stack code in fault path to improve fault performance
Matthew Dillon [Tue, 2 Mar 2010 00:09:41 +0000 (16:09 -0800)]
kernel - Move grow_stack code in fault path to improve fault performance

* grow_stack() calls were being performed unconditionally during a
  page fault.  Shift the code over to vm_fault() and only run it if
  the vm_map_lookup() call fails.

* Also take this opportunity to remove trapwrite() (added by Matt).

Submitted-by: Venkatesh Srinivas <me@endeavour.zapto.org>
14 years agokernel - VN - add missing disk_destroy() in module unload path
Matthew Dillon [Tue, 2 Mar 2010 00:07:25 +0000 (16:07 -0800)]
kernel - VN - add missing disk_destroy() in module unload path

* The module unload was leaving the disk list corrupted.  Add a missing
  disk_destroy() call.

* Fixes certain bulk-build issues (apparently the bulk build tries to
  unload and reload the VN driver at some point for reasons unknown).

14 years agotmpfs - Add support for setting the root uid/gid/mode for the tmpfs mount.
Matthew Dillon [Mon, 1 Mar 2010 01:02:40 +0000 (17:02 -0800)]
tmpfs - Add support for setting the root uid/gid/mode for the tmpfs mount.

* Link uid/gid/mode setup from mount_tmpfs into the tmpfs VFS.

Submitted-by: Naoya Sugioka <naoya.sugioka@gmail.com>
14 years agoMerge branch 'master' of /repository/git/dragonfly
Peter Avalos [Sun, 28 Feb 2010 04:04:54 +0000 (04:04 +0000)]
Merge branch 'master' of /repository/git/dragonfly

14 years agorc.conf.5: Remove bogus mdconfig(8) reference.
Sascha Wildner [Sun, 28 Feb 2010 02:51:03 +0000 (03:51 +0100)]
rc.conf.5: Remove bogus mdconfig(8) reference.

14 years agoMerge branch 'vendor/OPENSSL'
Peter Avalos [Sun, 28 Feb 2010 00:31:33 +0000 (00:31 +0000)]
Merge branch 'vendor/OPENSSL'

14 years agoImport OpenSSL-0.9.8m.
Peter Avalos [Sun, 28 Feb 2010 00:07:00 +0000 (00:07 +0000)]
Import OpenSSL-0.9.8m.

This new OpenSSL version is a security and bugfix release which
implements RFC5746 to address renegotiation vulnerabilities mentioned in
CVE-2009-3555. For a complete list of changes, please see the CHANGES
file.

14 years agong_eiface.4: Comment out some xrefs to ng_vlan(4) which we don't have.
Sascha Wildner [Sat, 27 Feb 2010 08:49:03 +0000 (09:49 +0100)]
ng_eiface.4: Comment out some xrefs to ng_vlan(4) which we don't have.

14 years agotmpfs(5): Remove old initialization (overrode prior init of vop_bmap).
Sascha Wildner [Fri, 26 Feb 2010 12:22:45 +0000 (13:22 +0100)]
tmpfs(5): Remove old initialization (overrode prior init of vop_bmap).

14 years agokernel - Remove msf_buf dependency from VFS Journals
Samuel J. Greear [Thu, 25 Feb 2010 16:11:16 +0000 (09:11 -0700)]
kernel - Remove msf_buf dependency from VFS Journals

* UIO writes (VOP_WRITE case) are now handled by a copyin() directly to the
journal buffer.

* VOP_PUTPAGES case is now handled with XIO directly instead of with msf_buf's
as an abstraction over XIO.

14 years agokernel - Initialize xio->xio_bytes properly in xio_init_pages()
Samuel J. Greear [Thu, 25 Feb 2010 16:06:53 +0000 (09:06 -0700)]
kernel - Initialize xio->xio_bytes properly in xio_init_pages()

14 years agoaps(4): use DRIVERSLEEP instead of tsleep
Constantine A. Murenin [Thu, 25 Feb 2010 05:54:19 +0000 (00:54 -0500)]
aps(4): use DRIVERSLEEP instead of tsleep