dragonfly.git
4 years agoenable WARNS_WERROR by default
Simon Schubert [Wed, 16 Sep 2009 11:47:47 +0000 (13:47 +0200)]
enable WARNS_WERROR by default

This is to catch new warnings sneaking into buildworld.  WARNS_WERROR
means that -Werror is added to sources iff compiled with WARNS >= 1.
All these sources have been fixed to currently compile without warnings.
Setting WARNS_WERROR helps us to maintain this status.

If your build should fail with a warning treated as error, you either
have introduced a new warning - in which case you will have to fix it
before committing - or you are using CFLAGS that exhibit warnings which
have not been fixed yet - in that case you should try and fix the
warning nevertheless.

*Only* if you are using compile flags which produce excess warnings, you
should disable WARNS_WERROR by setting NO_WERROR in make.conf.  If you
do, make *absolutely* sure that you don't introduce new warnings into
the build, since it will break the build for everybody else who does not
set NO_WERROR!

Discussed-with: swildner@

4 years agoatc(6): Include <stdlib.h> to silence some warnings.
Sascha Wildner [Wed, 16 Sep 2009 10:45:01 +0000 (12:45 +0200)]
atc(6): Include <stdlib.h> to silence some warnings.

Reported-by: corecode
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1514>

4 years agosysperf - call tests - fix stale compilation errors.
Matthew Dillon [Tue, 15 Sep 2009 23:25:29 +0000 (16:25 -0700)]
sysperf - call tests - fix stale compilation errors.

4 years agokernel - fix bug when issuing synchronous pageouts via contigmalloc.
Matthew Dillon [Tue, 15 Sep 2009 19:16:00 +0000 (12:16 -0700)]
kernel - fix bug when issuing synchronous pageouts via contigmalloc.

* There are multiple mis-checks in this code but the only path that
  causes the bug is if contigmalloc is forced to page data out, and
  that generally only occurs due to the USB subsystem.

* The bug causes relpbuf() to be called with the wrong argument,
  ultimately causing the swap pbuf availability counter to hit 0 and
  stay there.

* Fixes a umass insertion failure (the usb thread was locking up).

4 years agoinstaller: Small fix for the /dev/serno changes. v2.5.0
Sascha Wildner [Tue, 15 Sep 2009 14:21:16 +0000 (16:21 +0200)]
installer: Small fix for the /dev/serno changes.

Protect against the case where a /dev/serno/ directory exists but
the disk we want to install to doesn't have a node in it.

4 years agoAHCI - Note on previous commit, power management support.
Matthew Dillon [Tue, 15 Sep 2009 05:23:20 +0000 (22:23 -0700)]
AHCI - Note on previous commit, power management support.

The power management in commit f17a0cedb31c48322a90d0e6b2ef8df19e4d142d
was authored by Johannes Hofmann <johannes.hofmann@gmx.de>.  It got mixed
in with another commit and was not properly annotated.

4 years agoRELEASE 2.4 - Release Engineering on master adjust to 2.5
Matthew Dillon [Tue, 15 Sep 2009 01:56:16 +0000 (18:56 -0700)]
RELEASE 2.4 - Release Engineering on master adjust to 2.5

4 years agonrelease - USB image - use a noatime mount.
Matthew Dillon [Tue, 15 Sep 2009 00:57:40 +0000 (17:57 -0700)]
nrelease - USB image - use a noatime mount.

* Mount the root for a USB disk key boot noatime to avoid unnecessary writes
  to the USB disk key.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 15 Sep 2009 00:56:44 +0000 (17:56 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agofdisk - Use heads = 255 on file images
Matthew Dillon [Tue, 15 Sep 2009 00:54:11 +0000 (17:54 -0700)]
fdisk - Use heads = 255 on file images

When operating on a file image use max values for sectors and heads in
order to match the case where the file might exceed the CHS limit.  By
convention the CHS fields are set to all 1's in this case.

If our sectors and heads are not set at max values then the all 1's case
will result in a geometry that overflows the originally specified sectors
and heads which can brick the BIOS.

4 years agoamd64: sync AMD64_GENERIC and platform/files with i386
Simon Schubert [Tue, 15 Sep 2009 00:34:51 +0000 (02:34 +0200)]
amd64: sync AMD64_GENERIC and platform/files with i386

Pull up most devices from GENERIC into AMD64_GENERIC.  I left out those
that don't compile, which are basically only isa-only network drivers.

Temporarilty use the generic crypto functions until assembler versions
are imported.

4 years agobuildkernel, nrelease: use AMD64_GENERIC as kernel default config
Simon Schubert [Mon, 14 Sep 2009 22:47:58 +0000 (00:47 +0200)]
buildkernel, nrelease: use AMD64_GENERIC as kernel default config

buildkernel and nrelease both defaulted to GENERIC as kernel.  This does
not work for amd64 builds, since GENERIC is i386.

Add a makeshift hack by selecting AMD64_GENERIC if we're buildin for/on
amd64.  This needs to go away and be solved in a more sensible way.

Ok: dillon@

4 years agoinstaller: More /dev/serno work.
Sascha Wildner [Mon, 14 Sep 2009 21:25:06 +0000 (23:25 +0200)]
installer: More /dev/serno work.

Take back the devtab(5) support in the installer.

mountroot didn't work for the UFS with serial numbers case since the
data for '/' is taken from fstab and that would have a devtab label
in it and we're not setting vfs.root.mountfrom explicitly for UFS.
We don't want to, either.

So just use /dev/serno/* nodes (which will work everywhere) always.

Suggested-by: dillon
4 years agogames - mille - remove #ifdef madness
Matthew Dillon [Mon, 14 Sep 2009 21:16:59 +0000 (14:16 -0700)]
games - mille - remove #ifdef madness

Submitted-by: Ulrich Spoerlein <uqs@spoerlein.net>
4 years agogames - misc - clean up compiler warnings
Matthew Dillon [Mon, 14 Sep 2009 21:14:07 +0000 (14:14 -0700)]
games - misc - clean up compiler warnings

Submitted-by: Ulrich Spoerlein <uqs@spoerlein.net>
4 years agogames - hunt - minor include fix for portability.
Matthew Dillon [Mon, 14 Sep 2009 21:10:57 +0000 (14:10 -0700)]
games - hunt - minor include fix for portability.

Submitted-by: Ulrich Spoerlein <uqs@spoerlein.net>
4 years agogames - backgammon - use defined names instead of magic numbers.
Matthew Dillon [Mon, 14 Sep 2009 21:08:50 +0000 (14:08 -0700)]
games - backgammon - use defined names instead of magic numbers.

Submitted-by: Ulrich Spoerlein <uqs@spoerlein.net>
4 years agogames - bs - remove redundant libmytinfo
Matthew Dillon [Mon, 14 Sep 2009 21:06:31 +0000 (14:06 -0700)]
games - bs - remove redundant libmytinfo

Submitted-by: Ulrich Spoerlein <uqs@spoerlein.net>
4 years agogames - atc - replace sgtty with termios, remove #ifdef madness, fix warnings.
Matthew Dillon [Mon, 14 Sep 2009 21:05:02 +0000 (14:05 -0700)]
games - atc - replace sgtty with termios, remove #ifdef madness, fix warnings.

Submitted-by: Ulrich Spoerlein <uqs@spoerlein.net>
4 years agoinstaller: Add serial number and /etc/devtab support.
Sascha Wildner [Mon, 14 Sep 2009 18:30:06 +0000 (20:30 +0200)]
installer: Add serial number and /etc/devtab support.

If a disk has a corresponding entry in /dev/serno with identical
major/minor, use that for all further references of the disk in the
installation process.

In the installed system, set up a /etc/devtab entry (with the labels
named disk0, disk1 etc. using the order of the disks appearing in
'sysctl kern.disks' output) and use this label for the system's
/etc/fstab entries.

/boot/loader.conf still has to use /dev/serno for its vfs.root.mountfrom
entry.

The dumpdev entry in /etc/rc.conf could use the devtab label but (as
of this commit) doesn't do so yet. This will be fixed at a later point.

If no /dev/serno is found, or if no corresponding entry in /dev/serno
is found for a specific disk, we use the traditional scheme.

While I'm here, perform some cleanup, namely remove some duplicate
functions.

Requested-by-and-in-discussion-with: dillon

4 years agoKernel - change sync_on_panic default to 0
Matthew Dillon [Mon, 14 Sep 2009 18:12:33 +0000 (11:12 -0700)]
Kernel - change sync_on_panic default to 0

No longer attempt to sync the buffer cache when a panic occurs.  This
has always been problematic, HAMMER will ignore the attempt anyway,
and now we are formalizing that we no longer try.

This also improves the chances of the system dumping and rebooting
after a panic vs freezing up.

4 years agoRevert "Increase the default TCP maximum segment size from 512 to 1460."
Simon 'corecode' Schubert [Mon, 14 Sep 2009 17:08:04 +0000 (19:08 +0200)]
Revert "Increase the default TCP maximum segment size from 512 to 1460."

This reverts commit d190343e53819e25316a2a890724404f8e48c78d.

It seems that there are systems (probably firewalls) in action which
enforce an MSS of 536.

Specifically, at research.microsoft.com, port 80, packets seem to be
simply dropped if they exceed a MSS of 536 bytes, and no ICMP
destinatino unreachable, need to fragment message is generated.

While this behavior might be questionable as well, we should not diverge
from established standards.

This default MSS value can be changed using the sysctl node
net.inet.tcp.mssdflt.

Mandated by RFC 879, RFC 1122.

4 years agoext2fs - A few bug fixes and syntax adjustments.
Matthew Dillon [Mon, 14 Sep 2009 05:12:25 +0000 (22:12 -0700)]
ext2fs - A few bug fixes and syntax adjustments.

* Primarily fix a brelse that needs to be placed before a vx_put instead
  of after.  And use bqrelse() instead of brelse() when retrieving an inode.

* Syntax adjustments.

* NOTE: Only part of the FreeBSD patch was applied.

Submitted-by: "Pedro F. Giffuni" <pfgshield-freebsd@yahoo.com> (GSOC project)
4 years agoAHCI - zero-pad ATAPI commands
Matthew Dillon [Mon, 14 Sep 2009 03:29:44 +0000 (20:29 -0700)]
AHCI - zero-pad ATAPI commands

* ATAPI commands sent via the SCSI layer which are less then 16 bytes
  are now zero-padded to 16 bytes.  The SATA protocol itself just sends
  the whole FIS, so no more or less data is being sent.  But extra bytes
  will not be sent as zero.

Discussed-with: "Alex Hornung" <ahornung@gmail.com>

4 years agoAHCI - No longer cycle the port during port initialization
Matthew Dillon [Mon, 14 Sep 2009 03:26:42 +0000 (20:26 -0700)]
AHCI - No longer cycle the port during port initialization

* Do not try to start the port during port initialization.  ST is not
  supposed to be set unless we detect a device on the port(?).

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 13 Sep 2009 23:36:03 +0000 (16:36 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agoDEVFS - Fixed missed unlock when attempting to list a hidden directory
Matthew Dillon [Sun, 13 Sep 2009 23:35:26 +0000 (16:35 -0700)]
DEVFS - Fixed missed unlock when attempting to list a hidden directory

Reported-by: Sascha Wildner <swildner@crater.dragonflybsd.org>
4 years agoMakefile.inc1: don't build aicasm
Simon Schubert [Sun, 13 Sep 2009 22:55:42 +0000 (00:55 +0200)]
Makefile.inc1: don't build aicasm

aicasm is built by the kernel Makefile, so there is no need to do this
from Makefile.inc1.

4 years agomake upgrade: Remove a file that was existing with a dir name for a while.
Sascha Wildner [Sun, 13 Sep 2009 22:28:12 +0000 (00:28 +0200)]
make upgrade: Remove a file that was existing with a dir name for a while.

mtree couldn't create the directory because of that.

This can't be fixed with Makefile_upgrade.inc so we need a bit of
additional code for such cases.

4 years agoSync LiveDVD kernel configs with GENERIC.
Sascha Wildner [Sun, 13 Sep 2009 22:01:44 +0000 (00:01 +0200)]
Sync LiveDVD kernel configs with GENERIC.

4 years agomtree: No longer create /usr/libdata/msdosfs.
Sascha Wildner [Sun, 13 Sep 2009 22:01:10 +0000 (00:01 +0200)]
mtree: No longer create /usr/libdata/msdosfs.

4 years agomake upgrade: Take back destroy_dev(9), it still exists.
Sascha Wildner [Sun, 13 Sep 2009 22:00:27 +0000 (00:00 +0200)]
make upgrade: Take back destroy_dev(9), it still exists.

4 years agoSwitch pkg_radd and pkg_search to appropriate CPU type path, i386 or amd64.
Justin C. Sherrill [Sun, 13 Sep 2009 19:55:37 +0000 (12:55 -0700)]
Switch pkg_radd and pkg_search to appropriate CPU type path, i386 or amd64.

4 years agoDEVFS - Wait an extra 2 seconds before looking for the root mount
Matthew Dillon [Sun, 13 Sep 2009 18:00:17 +0000 (11:00 -0700)]
DEVFS - Wait an extra 2 seconds before looking for the root mount

* Some drivers pickup devices asynchronously in a manner which the
  intitial CAM probe does not cover.  Try to give these drivers a little
  extra time to pickup devices before mounting root.  This is a hack.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 13 Sep 2009 17:58:56 +0000 (10:58 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agoDEVFS - Fix unprintables in serial numbers reported by the device
Matthew Dillon [Sun, 13 Sep 2009 17:57:37 +0000 (10:57 -0700)]
DEVFS - Fix unprintables in serial numbers reported by the device

* Some device serial numbers contain weird punctuation and unprintable
  characters.  Replace unprintables and other weird characters with
  underscores.

Testing-by: Sascha Wildner <swildner@crater.dragonflybsd.org>
4 years ago/etc/devtab: Fix wording in comments.
Sascha Wildner [Sun, 13 Sep 2009 17:24:11 +0000 (19:24 +0200)]
/etc/devtab: Fix wording in comments.

4 years agoAdjust/cleanup fstab.5 a bit.
Sascha Wildner [Sun, 13 Sep 2009 15:47:00 +0000 (17:47 +0200)]
Adjust/cleanup fstab.5 a bit.

4 years agoAdd a tentative devtab(5) manual page.
Sascha Wildner [Sun, 13 Sep 2009 15:45:39 +0000 (17:45 +0200)]
Add a tentative devtab(5) manual page.

4 years agoGENERIC - add device kbdmux
Alex Hornung [Sun, 13 Sep 2009 07:52:57 +0000 (08:52 +0100)]
GENERIC - add device kbdmux

* kbdmux should be part of the GENERIC kernel, as it solves a lot of
  multi-keyboard issues, if not all.

4 years agokbdmux - Add missing opt_kbd.h include
Alex Hornung [Sun, 13 Sep 2009 07:50:50 +0000 (08:50 +0100)]
kbdmux - Add missing opt_kbd.h include

* Add missing opt_kbd.h include so that whenever KBD_INSTALL_CDEV is set
  in the kernel config, kbdmux also gets it kbdX installed.

Reported-by: Sascha Wildner
4 years agonrelease - generate git repos for pkgsrc and (if a gui build) src
Matthew Dillon [Sun, 13 Sep 2009 03:50:27 +0000 (20:50 -0700)]
nrelease - generate git repos for pkgsrc and (if a gui build) src

* Ship a git repo for /usr/pkgsrc and (for the gui build) /usr/src.
  Installations from the ISO can then do an incremental update using
  the git repo as a base right off the bat, saving users a lot of
  time and effort.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 13 Sep 2009 02:25:06 +0000 (19:25 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agonrelease - Redo /usr/Makefile to use only git repos.
Matthew Dillon [Sun, 13 Sep 2009 02:11:26 +0000 (19:11 -0700)]
nrelease - Redo /usr/Makefile to use only git repos.

* Make and make help are now context sensitive based on what files
  already exist in /usr/pkgsrc and /usr/src (if any).

* Use git for the pkgsrc repo.

* Use a remote setup instead of git-clone to make it easier to add
  additional remotes.

4 years agolibiconv: change mount_ntfs to use libkiconv.
Alexander Polakov [Sat, 12 Sep 2009 23:32:47 +0000 (03:32 +0400)]
libiconv: change mount_ntfs to use libkiconv.

Drop -W, add -C.

4 years agolibiconv: convert NTFS to libiconv.
Alexander Polakov [Sat, 12 Sep 2009 23:22:09 +0000 (03:22 +0400)]
libiconv: convert NTFS to libiconv.

Partly-taken-from: FreeBSD

4 years agomount_msdos: Remove some /usr/libdata/msdosfs remains.
Sascha Wildner [Sat, 12 Sep 2009 18:43:30 +0000 (20:43 +0200)]
mount_msdos: Remove some /usr/libdata/msdosfs remains.

4 years agomount_cd9660.8: Reduce differences to FreeBSD a bit.
Sascha Wildner [Sat, 12 Sep 2009 18:26:58 +0000 (20:26 +0200)]
mount_cd9660.8: Reduce differences to FreeBSD a bit.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 12 Sep 2009 17:44:21 +0000 (10:44 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agomount_cd9660: change to FreeBSD-like behaviour.
Alexander Polakov [Sat, 12 Sep 2009 17:09:17 +0000 (21:09 +0400)]
mount_cd9660: change to FreeBSD-like behaviour.

 * fix a segfault
 * change -L to -C
 * add -C to manpage

Reported-by: Simon Schubert
Dragonfly-bug: http://bugs.dragonflybsd.org/issue1501

4 years agobackgammon(6)/hack(6)/larn(6): replace sgtty with termios
Sascha Wildner [Sat, 12 Sep 2009 15:37:36 +0000 (17:37 +0200)]
backgammon(6)/hack(6)/larn(6): replace sgtty with termios

Courtesy of FreeBSD ports.

Also does some additional cleanup.

Submitted-by: Ulrich Spoerlein <uqs@spoerlein.net>
Dragonfly-bugs: <http://bugs.dragonflybsd.org/issue1491>
                <http://bugs.dragonflybsd.org/issue1492>
                <http://bugs.dragonflybsd.org/issue1493>

4 years agodevfs.5: chmod 644 :(
Sascha Wildner [Sat, 12 Sep 2009 14:57:28 +0000 (16:57 +0200)]
devfs.5: chmod 644 :(

4 years agoatomic.h: use system namespace for function arguments
Simon Schubert [Sat, 12 Sep 2009 14:41:25 +0000 (16:41 +0200)]
atomic.h: use system namespace for function arguments

We shouldn't use non-system arguments for function arguments in headers,
since it might collide with other symbols.  In this case it collided
with exp(3) from math.h, both included by top(1) (with indirections).

Reported-by: swildner@
4 years agogcc44/gmp: remove Makefile hack, it is fixed proper in bsd.dep.mk
Simon Schubert [Sat, 12 Sep 2009 09:20:52 +0000 (11:20 +0200)]
gcc44/gmp: remove Makefile hack, it is fixed proper in bsd.dep.mk

4 years agobsd.dep.mk: fix race condition with beforedepend
Simon Schubert [Sat, 12 Sep 2009 08:58:37 +0000 (10:58 +0200)]
bsd.dep.mk: fix race condition with beforedepend

The recent depend changes introduced a possible race between running
mkdep and beforedepend, since the .ORDER was only specified for
beforedepend and ${DEPENDFILE}, but not for the intermediate
${_DEPENDFILES}.

4 years agoAdd a devfs(5) manual page (based on FreeBSD's).
Sascha Wildner [Sat, 12 Sep 2009 14:55:04 +0000 (16:55 +0200)]
Add a devfs(5) manual page (based on FreeBSD's).

4 years agokbdmux.4: chmod 644
Sascha Wildner [Sat, 12 Sep 2009 14:28:25 +0000 (16:28 +0200)]
kbdmux.4: chmod 644

4 years agokbdcontrol.1: Reduce differences with FreeBSD a bit.
Sascha Wildner [Sat, 12 Sep 2009 14:27:27 +0000 (16:27 +0200)]
kbdcontrol.1: Reduce differences with FreeBSD a bit.

4 years agoAdd kbdmux to LINT.
Sascha Wildner [Sat, 12 Sep 2009 14:27:10 +0000 (16:27 +0200)]
Add kbdmux to LINT.

4 years agoAdd a kbdmux(4) manual page (taken from FreeBSD).
Sascha Wildner [Sat, 12 Sep 2009 14:26:57 +0000 (16:26 +0200)]
Add a kbdmux(4) manual page (taken from FreeBSD).

4 years agopfi: Adjust a bit better for devfs.
Sascha Wildner [Sat, 12 Sep 2009 13:41:32 +0000 (15:41 +0200)]
pfi: Adjust a bit better for devfs.

Only check for pfi.conf on devices which exist in /dev. This reduces some
error messages upon LiveCD boot.

4 years agoinstaller: Add dumpdev support.
Sascha Wildner [Sat, 12 Sep 2009 12:31:04 +0000 (14:31 +0200)]
installer: Add dumpdev support.

* Use the configured swap with dumpon for the installation.

* Automatically add a dumpdev entry in the installed system's /etc/rc.conf.

4 years agodevfs - change default GID to wheel
Alex Hornung [Sat, 12 Sep 2009 09:43:54 +0000 (10:43 +0100)]
devfs - change default GID to wheel

* Change the default GID (used for every non-device node) to wheel.

Suggested-by: Sascha Wildner
4 years agoptsname,posix_openpt - move to libc/stdlib
Alex Hornung [Sat, 12 Sep 2009 07:58:21 +0000 (08:58 +0100)]
ptsname,posix_openpt - move to libc/stdlib

* As the unix98 pty functions ptsname, grantpt, unlockpt and
  posix_openpt are part of stdlib, it makes more sense having them in
  stdlib/ rather than in gen/.

4 years agoptsname - Minor fixes
Alex Hornung [Fri, 11 Sep 2009 22:11:49 +0000 (23:11 +0100)]
ptsname - Minor fixes

* Return NULL and not error on __is* checks.

* Add ending newline.

Reported-by: Sascha Wildner
4 years agodiskmbr - Don't use 'tempname', use dsname()
Alex Hornung [Fri, 11 Sep 2009 21:59:02 +0000 (22:59 +0100)]
diskmbr - Don't use 'tempname', use dsname()

* sname was initially assigned "tempname" and then never changed
  using dsname as intended. Now we properly call dsname before
  printing sname.

Reported-By: Sascha Wildner
4 years agoHAMMER - Update hammer.5 manual page
Matthew Dillon [Fri, 11 Sep 2009 19:18:42 +0000 (12:18 -0700)]
HAMMER - Update hammer.5 manual page

* Add a description of how the bioq sysctls can be adjusted to give
  reads an even higher priority over writes.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 11 Sep 2009 17:20:47 +0000 (10:20 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agoHAMMER - HAMMERIOC_GETHISTORY ioctl fails on directories in PFSs
Matthew Dillon [Fri, 11 Sep 2009 17:19:39 +0000 (10:19 -0700)]
HAMMER - HAMMERIOC_GETHISTORY ioctl fails on directories in PFSs

* The HAMMERIOC_GETHISTORY ioctl on a directory inside a PFS other then
  the root PFS would fail due to an incorrect localization assignment.
  Fix the assignment.

Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
4 years agogetcwd: Return proper error codes.
Stathis Kamperis [Fri, 11 Sep 2009 14:56:57 +0000 (17:56 +0300)]
getcwd: Return proper error codes.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1394
Reported-by: hasso@
4 years agodevfs - populate statfs f_files properly
Alex Hornung [Fri, 11 Sep 2009 08:59:30 +0000 (09:59 +0100)]
devfs - populate statfs f_files properly

* Now we set statfs f_files to the total number of currently allocated
  devfs_nodes.

Reported-by: Sascha Wildner
4 years agokbdmux - Bind into module build Makefile
Alex Hornung [Fri, 11 Sep 2009 08:36:59 +0000 (09:36 +0100)]
kbdmux - Bind into module build Makefile

4 years agoFix MLINKS.
Sascha Wildner [Fri, 11 Sep 2009 08:20:24 +0000 (10:20 +0200)]
Fix MLINKS.

4 years agoconf.h - Fix buildworld
Alex Hornung [Fri, 11 Sep 2009 07:51:03 +0000 (08:51 +0100)]
conf.h - Fix buildworld

* Don't use cdev_t in struct cdev, but rather use struct cdev itself.

Reported-by: Hasso Tepper
4 years agokbdcontrol - Add support for kbdmux
Alex Hornung [Thu, 10 Sep 2009 10:04:46 +0000 (11:04 +0100)]
kbdcontrol - Add support for kbdmux

* Add support to kbdcontrol to attach and detach keyboards from the
  keyboard multiplexer (kbdmux).

Obtained-from: FreeBSD

4 years agokbdmux - make it work for us
Alex Hornung [Wed, 9 Sep 2009 13:54:18 +0000 (14:54 +0100)]
kbdmux - make it work for us

* port kbdmux to DragonFly.

* change syscons to use kbdmux, if available.

* change kbd to use kbdmux, if available.

* cleanup kbd.

* use a simple buffer instead of clists for kbd.

* move kbd_ macros from syscons.h to kbdregs.h

* use kbd_ macros everywhere instead of unreadable stuff.

* sync ukbd with FreeBSD's latest ukbd before their switch to
  usb4bsd.

Partially-Obtained-from: FreeBSD

4 years agokbdmux - Initial import from FreeBSD
Alex Hornung [Wed, 9 Sep 2009 07:23:44 +0000 (08:23 +0100)]
kbdmux - Initial import from FreeBSD

* Import unmodified kbdmux from FreeBSD revision 193752.

Obtained-from: FreeBSD

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 11 Sep 2009 06:54:22 +0000 (23:54 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agoFix buildworld issues - conditionalize thread.h in mountctl.h
Matthew Dillon [Fri, 11 Sep 2009 06:52:00 +0000 (23:52 -0700)]
Fix buildworld issues - conditionalize thread.h in mountctl.h

* mountctl.h only needs thread.h if being compiled by the kernel.

4 years agounix98 ptys - Add man pages
Alex Hornung [Fri, 11 Sep 2009 06:46:00 +0000 (07:46 +0100)]
unix98 ptys - Add man pages

* Add man pages for ptsname, grantpt, unlockpt and posix_openpt

Reported-By: Sascha Wildner
4 years agomake_dev(9) - Update man page for make_dev_covering
Alex Hornung [Fri, 11 Sep 2009 06:25:12 +0000 (07:25 +0100)]
make_dev(9) - Update man page for make_dev_covering

4 years agodisk - use make_dev_covering instead of make_dev
Alex Hornung [Fri, 11 Sep 2009 06:13:27 +0000 (07:13 +0100)]
disk - use make_dev_covering instead of make_dev

* Switch subr_disk to use the new make_dev_covering so proper major
  numbers will appear.
  This was especially an issue because there could be major/minor
  collisions.

Reported-By: Sascha Wildner
4 years agodevfs - Add new make_dev_covering
Alex Hornung [Fri, 11 Sep 2009 06:10:09 +0000 (07:10 +0100)]
devfs - Add new make_dev_covering

* Add a new make_dev_covering which is used by systems such as the disk
  subsystem, that make_dev for an underlying device.

4 years agokgdb - Add -D_KERNEL_STRUCTURES to access kernel structures properly.
Matthew Dillon [Fri, 11 Sep 2009 05:54:06 +0000 (22:54 -0700)]
kgdb - Add -D_KERNEL_STRUCTURES to access kernel structures properly.

Reported-by: Stathis Kamperis
4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 11 Sep 2009 02:16:49 +0000 (19:16 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agoKERNEL - Implement a poor man's ioscheduler using sys/iosched.h
Matthew Dillon [Fri, 11 Sep 2009 02:12:08 +0000 (19:12 -0700)]
KERNEL - Implement a poor man's ioscheduler using sys/iosched.h

* Move struct iosched_data from the LWP to the TD.

* Expand bd_wait()'s wakeup array from 128 entries to 16384 entries
  to cover a larger portion of the buffer cache's dirty space.

* bwillwrite() now adds to iosched_data->iowbytes and the ticks
  global is used to decay it.

  Total iowbytes is kept in per-cpu structures.  Each cpu does not
  necessarily match the threads assigned to it, but in aggregate
  the sum of iowbytes for all cpus will match the sum of iowbytes
  for all threads in the system.

* bwillwrite() now calculates a relative I/O write load for each thread
  in the system and passes a fractional calculation to bd_wait().

  This causes processes with low I/O loads to have a higher priority
  (as in, NOT stall in bd_wait() anywhere near as long), and processes
  with high I/O loads to have a lower priority (stall longer in bd_wait()),
  when the buffer cache is saturated with dirty data.

4 years agoHAMMER - Try to improve backend stalls due to heavy write activity.
Matthew Dillon [Fri, 11 Sep 2009 02:05:00 +0000 (19:05 -0700)]
HAMMER - Try to improve backend stalls due to heavy write activity.

* Call hammer_inode_waitreclaims() instead of hammer_inode_waithard(),
  and disable hammer_inode_waithard().

  hammer_inode_waithard() waits for an entire flush cycle but can get
  called by fairly innocuous VNOPS, causing a large number of processes
  to stall for no good reason.

* Change hammer_inode_waitreclaims() to wait for only one reclaim to occur
  before returning, instead of 2.

4 years agoIPV6 - Attempt to fix tcp46 compatibility listen sockets
Matthew Dillon [Thu, 10 Sep 2009 04:52:01 +0000 (21:52 -0700)]
IPV6 - Attempt to fix tcp46 compatibility listen sockets

* When creating the accepted socket via the syncache, if the
  listen socket is INET6 but allows compatibility connections
  the inp created via sonewconn() will probably set IN6P_IPV6_V6ONLY.

  This flag must be cleared if the incoming connection is
  actually IPV4, otherwise tcp6_soport() will not properly
  fall through to tcp_soport().

* NOTE: Even though the connection is IPV4 the socket's protocol
  is copied from the listen socket which is INET6.  This seems
  to work ok but it isn't ideal.

* When connecting make sure that IPV6 connections use cpu 0 for
  now (we don't have a proper hash for IPV6 addresses yet).

Reported-by: corecode
4 years agogcc44/gmp: fix last commit
Simon Schubert [Wed, 9 Sep 2009 19:25:55 +0000 (21:25 +0200)]
gcc44/gmp: fix last commit

4 years agoKernel - Enable the TCP inflight limiter by default, but with generous values.
Matthew Dillon [Wed, 9 Sep 2009 16:34:13 +0000 (09:34 -0700)]
Kernel - Enable the TCP inflight limiter by default, but with generous values.

The inflight limiter is now turned on by default, but with generous values
which should allow maximal bandwidth.  In particular, the slop defaults to
50 (5 packets), meaning that the TCP connection will allow up to N+5 packets
in-flight instead of just N, where N is the number of packets calculated
for the bandwidth-delay product of the connection.

The reason for doing this is that the limiter is the only mechanism we
have which seems to do a really good job preventing receiver RX rings
on network interfaces from getting blown out.  Even though GigE/10GigE
is supposed to flow control it looks like either it doesn't actually
do it or Open Source drivers do not properly enable it.  Large packet
bursts appear to be able to blow out the receiver's rx ring.

People using the limiter to reduce bottlenecks on slower WAN connections
should set the slop to 20 (2 packets).

4 years agoMBUF - Do not limit an objcache common pool to 10 magazines.
Matthew Dillon [Wed, 9 Sep 2009 16:17:57 +0000 (09:17 -0700)]
MBUF - Do not limit an objcache common pool to 10 magazines.

* An objcache's common magazine pool was limited to 10 in order to return
  memory to the system sooner rather then later.

  This created a situation with the mbuf allocator where high-rate
  mbuf producers (GigE, 10GigE) would sometimes not be able to allocate
  a large enough batch of mbufs and drop packets.  10 magazines x 64 is
  only 640 mbufs.

* Increase the limit from 10 to 1000.

Tested-with: 10GigE setup from Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>

4 years agoMBUF - Account for failed allocations so netstat -m reports properly.
Matthew Dillon [Wed, 9 Sep 2009 16:17:18 +0000 (09:17 -0700)]
MBUF - Account for failed allocations so netstat -m reports properly.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 9 Sep 2009 16:13:22 +0000 (09:13 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agoNFE - Change default RX ring size from 128 -> 256, Adjust moderation timer.
Matthew Dillon [Wed, 9 Sep 2009 16:10:58 +0000 (09:10 -0700)]
NFE - Change default RX ring size from 128 -> 256, Adjust moderation timer.

* NFE does not seem to be able to flow control the phy.  TCP reception
  using window scaling and large socket bufs can blow out the receiver ring
  before the interrupt has a chance to drain it.

  This results in the receiver dropping a packet and the transmitter
  seeing bursts of duplicate TCP acks and having to go into recovery.

* Shorten the moderation timer from 500uS to 250uS, increasing its
  frequency from 2000Hz to 4000Hz.  Note that the moderation timer
  only kicks in when the discrete interrupt rate exceeds the frequency.

* The problem still occurs with the larger RX ring and shorter moderation
  timer, but not nearly as often.

4 years agogcc44/gmp: make directories before populating them
Simon Schubert [Wed, 9 Sep 2009 15:23:39 +0000 (17:23 +0200)]
gcc44/gmp: make directories before populating them

The snapshot build seems to have uncovered a race in the depend stage.
This is a tentative, unverified fix.

4 years agoRevert "Move isonum_ declaration to iso.h"
Alexander Polakov [Wed, 9 Sep 2009 09:43:08 +0000 (13:43 +0400)]
Revert "Move isonum_ declaration to iso.h"

This reverts commit f5ff88dca23b1b8f4b9287fb7c59959eb976a808. It
broke sysutils/hal and maybe something else.

Requested-by: Hasso Tepper
4 years agonfs: fix real/effective id mismatch in nfs_access
Nicolas Thery [Wed, 9 Sep 2009 07:39:02 +0000 (09:39 +0200)]
nfs: fix real/effective id mismatch in nfs_access

When access(2) or faccessat(2) without AT_EACCESS are called on
NFS file, use real uid/gid.

When faccessat(2) with AT_EACCESS set is called on NFS file, use
effective uid/gid.

4 years agopowernow - only build for i386, BIOS macros currently broken for 64-bit.
Matthew Dillon [Wed, 9 Sep 2009 04:03:05 +0000 (21:03 -0700)]
powernow - only build for i386, BIOS macros currently broken for 64-bit.

4 years agoUSB - Reintroduce OHCI fixes without the larger polling infrastructure fixes
Matthew Dillon [Tue, 8 Sep 2009 23:52:33 +0000 (16:52 -0700)]
USB - Reintroduce OHCI fixes without the larger polling infrastructure fixes

* Fix the OHCI interrupt livelock issue.

* Don't fix races with turning polling on and off yet as there appear
  to be other issues with OHCI that break whene we do.

4 years agoNFS - Fix panic if the readdir base offset is beyond the directory EOF
Matthew Dillon [Tue, 8 Sep 2009 21:31:20 +0000 (14:31 -0700)]
NFS - Fix panic if the readdir base offset is beyond the directory EOF

* A calculation could cause an signed underflow into unsigned if
  the base offset in a getdirentries call exceeds the directory
  EOF offset.