dragonfly.git
14 years agoBring in ISCSI initiator support.
Matthew Dillon [Mon, 24 Aug 2009 15:59:40 +0000 (08:59 -0700)]
Bring in ISCSI initiator support.

* Port ISCSI initiator support from FreeBSD.

* Additional work to help stabilize it.

Submitted-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
Taken-from: FreeBSD

14 years agoRename msleep() to ssleep().
Matthew Dillon [Mon, 24 Aug 2009 15:43:19 +0000 (08:43 -0700)]
Rename msleep() to ssleep().

* msleep() was taking a spinlock.  Rename to ssleep() as per old request
  from hsu.

* Our mtx functions currently use mtxsleep().  Leave msleep() unassigned
  to make porting easier.

14 years agoRename serialize_sleep() to zsleep()
Matthew Dillon [Mon, 24 Aug 2009 15:31:17 +0000 (08:31 -0700)]
Rename serialize_sleep() to zsleep()

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 24 Aug 2009 15:20:02 +0000 (08:20 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agofsync - Add sysctl to relax fsync requirements.
Matthew Dillon [Mon, 24 Aug 2009 15:16:14 +0000 (08:16 -0700)]
fsync - Add sysctl to relax fsync requirements.

* sysctl vfs.hammer.fsync_mode (defaults to 0 == full fsync semantics).

0 - full fsync semantics
1 - asynchronous
2 - synchronous fsync on close if fsync called prior to close
3 - asynchronous fsync on close if fsync called prior to close
4 - ignore fsync (30-second system sync takes care of it)

* This is likely a temporary measure until HAMMER gets a REDO log.
  It is mainly to facilitate testing and to reduce the pounding
  disks take from pkgsrc bulk builds (pkg_add seems to insist on
  calling fsync() a lot for no reason).

14 years agoAdd a flags argument to VOP_FSYNC()
Matthew Dillon [Mon, 24 Aug 2009 15:15:17 +0000 (08:15 -0700)]
Add a flags argument to VOP_FSYNC()

* So filesystem code knows whether it is being called from userland or not.

14 years agobrgphy: Add support for BCM5722
Sepherosa Ziehau [Mon, 24 Aug 2009 10:59:42 +0000 (18:59 +0800)]
brgphy: Add support for BCM5722

14 years agomiibus: miidevs.h regen
Sepherosa Ziehau [Mon, 24 Aug 2009 10:58:28 +0000 (18:58 +0800)]
miibus: miidevs.h regen

14 years agomiibus: Add PHY id for BCM5722
Sepherosa Ziehau [Mon, 24 Aug 2009 10:57:49 +0000 (18:57 +0800)]
miibus: Add PHY id for BCM5722

14 years agoremove more kerberos/heimdal
Simon Schubert [Mon, 24 Aug 2009 09:52:28 +0000 (11:52 +0200)]
remove more kerberos/heimdal

14 years agonfs: init real/saved uid/gid in server-side credentials
Nicolas Thery [Sun, 23 Aug 2009 19:04:21 +0000 (21:04 +0200)]
nfs: init real/saved uid/gid in server-side credentials

When unmarshalling a request, the server constructs a ucred
structure (nfsrv_descript.nd_cr) from the credential data in the
RPC.  It initializes only the effective uid and gid and leaves
the real and saved uid/gid unitialized.  This effectively sets
the real/effective ids to root because nd_cr is first
bzero()'ed.

As a consequence, now that accept(2) checks real uid/gid, all
accept calls to NFS files incorrectly succeed.

Fix this by initializing the real and saved uid/gid in nd_cr to
the same values as the real uid/gid (only the real uid/gid are
RPC'ed to the server).

NOTE: accept(2) and faccessat(2) to NFS files are still broken
in part because the client sends the effective uid/gid to the
server.  I'll fix this once I've groked the uid magic in the NFS
code.

14 years agoremove kerberos/heimdal
Simon Schubert [Sun, 23 Aug 2009 16:47:03 +0000 (18:47 +0200)]
remove kerberos/heimdal

14 years agoremove gcc34
Simon Schubert [Sun, 23 Aug 2009 11:32:14 +0000 (13:32 +0200)]
remove gcc34

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 23 Aug 2009 16:28:55 +0000 (09:28 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoPF - Must set FW_MBUF_REDISPATCH when translating input packets
Matthew Dillon [Sun, 23 Aug 2009 10:19:02 +0000 (03:19 -0700)]
PF - Must set FW_MBUF_REDISPATCH when translating input packets

* If a TCP or UDP input packet is translated and happens to be
  destined to the local host, FW_MBUF_REDISPATCH must be set
  or it may end up on the wrong protocol stack and generate a
  (e.g.) TCP RST.

* This fixes 'nat' rulesets, and probably others.

14 years agoNetwork - redispatch was not properly adjust ip->ip_len
Matthew Dillon [Sun, 23 Aug 2009 10:17:27 +0000 (03:17 -0700)]
Network - redispatch was not properly adjust ip->ip_len

* ip->ip_len is adjusted down by hlen.  If a redispatch occurs it must
  be corrected back up in order to do the ip_mport() function.  Otherwise
  the function may fail in its length check code.

14 years agociss(4): Use a more proper fix to silence the ciss_print0() warning.
Sascha Wildner [Sun, 23 Aug 2009 08:08:37 +0000 (10:08 +0200)]
ciss(4): Use a more proper fix to silence the ciss_print0() warning.

The real problem was that -DCISS_DEBUG=0 in the Makefile still defined
CISS_DEBUG which isn't supposed to be defined by default.

14 years agoadd faccessat(2) syscall
Nicolas Thery [Sun, 23 Aug 2009 06:18:28 +0000 (08:18 +0200)]
add faccessat(2) syscall

Also add its libc_r wrapper and man page.

14 years agovfs: add support for incoming faccessat(2) syscall
Nicolas Thery [Sat, 22 Aug 2009 22:37:44 +0000 (00:37 +0200)]
vfs: add support for incoming faccessat(2) syscall

Add flags argument to vop_access and change vop_helper_access()
to check access against real or effective uid/gid depending on
AT_EACCESS presence in flags.

NOTE: nfs_access() may need to be changed too but I haven't yet
managed to figure out whether if should use real or effective uid
depending on AT_EACCESS.

Approved-by: dillon@, corecode@
14 years agoaccess(2): fix confusion between real and effective uid/gid
Nicolas Thery [Sat, 22 Aug 2009 17:31:24 +0000 (19:31 +0200)]
access(2): fix confusion between real and effective uid/gid

Posix states that access() shall check permissions against
real uid and gid but our implementation was using effective
uid and gid instead.

Change vop_helper_access accordingly.

NOTE: This code will change soon when faccessat(2) is implemented
but I'd rather not mix the bug fix with a new feature in a single
commit.

NOTE: nfs_access() may need to be fixed too but I haven't
managed yet to figure out whether it should use real or
effective uid.

Fix-suggested-by: Alex Hornung <ahornung@gmail.com>
Approved-by: dillon@
14 years agonwfs: refactor nwfs_access to use vop_helper_access
Nicolas Thery [Sat, 22 Aug 2009 22:04:17 +0000 (00:04 +0200)]
nwfs: refactor nwfs_access to use vop_helper_access

14 years agosmbfs: refactor smbfs_access to use vop_helper_access
Nicolas Thery [Sat, 22 Aug 2009 21:58:35 +0000 (23:58 +0200)]
smbfs: refactor smbfs_access to use vop_helper_access

14 years agonfs: refactor nfs_laccess to use vop_helper_access
Nicolas Thery [Sat, 22 Aug 2009 21:48:02 +0000 (23:48 +0200)]
nfs: refactor nfs_laccess to use vop_helper_access

14 years agoprocfs: refactor vop_access to use vop_helper_access
Nicolas Thery [Sat, 22 Aug 2009 20:23:32 +0000 (22:23 +0200)]
procfs: refactor vop_access to use vop_helper_access

14 years agoufs: refactor vop_access to use vop_helper_access
Nicolas Thery [Sat, 22 Aug 2009 16:48:16 +0000 (18:48 +0200)]
ufs: refactor vop_access to use vop_helper_access

14 years agoudf: refactor vop_access to use vop_helper_access
Nicolas Thery [Sat, 22 Aug 2009 14:16:51 +0000 (16:16 +0200)]
udf: refactor vop_access to use vop_helper_access

14 years agomsdosfs: refactor vop_access to use vop_helper_access
Nicolas Thery [Wed, 19 Aug 2009 05:27:40 +0000 (07:27 +0200)]
msdosfs: refactor vop_access to use vop_helper_access

14 years agoisofs: refactor vop_access to use vop_helper_access
Nicolas Thery [Wed, 19 Aug 2009 05:20:06 +0000 (07:20 +0200)]
isofs: refactor vop_access to use vop_helper_access

14 years agohpfs: refactor vop_access to use vop_helper_access
Nicolas Thery [Wed, 19 Aug 2009 05:08:31 +0000 (07:08 +0200)]
hpfs: refactor vop_access to use vop_helper_access

14 years agoext2: refactor vop_access to use vop_helper_access
Nicolas Thery [Tue, 11 Aug 2009 07:14:13 +0000 (09:14 +0200)]
ext2: refactor vop_access to use vop_helper_access

14 years agoremove #ifdef'ed out quota code from vop_helper_access
Nicolas Thery [Tue, 11 Aug 2009 07:19:23 +0000 (09:19 +0200)]
remove #ifdef'ed out quota code from vop_helper_access

Callers can perform quota-specific checks if needed before
calling vop_helper_access.

14 years ago'at' syscalls: remove unneeded _AT_SYMLINK_MASK constant
Nicolas Thery [Sat, 22 Aug 2009 18:16:55 +0000 (20:16 +0200)]
'at' syscalls: remove unneeded _AT_SYMLINK_MASK constant

14 years agoAMD64 - Fix unsigned promotion that was meant to be a signed promotion
Matthew Dillon [Sat, 22 Aug 2009 23:06:14 +0000 (16:06 -0700)]
AMD64 - Fix unsigned promotion that was meant to be a signed promotion

* When casting the result if a TCP sequence space difference to a long
  we must first cast to tcp_seq_diff_t or the promotion will not
  sign-extend the result.

14 years agoAMD64 - Fix just enough of the missing prototypes to help vi not crash
Matthew Dillon [Sat, 22 Aug 2009 23:03:57 +0000 (16:03 -0700)]
AMD64 - Fix just enough of the missing prototypes to help vi not crash

Reported-by: tuxillo
14 years agoChange TCP_MIN_WINSHIFT from 6 to 5 to accomodate broken firewalls.
Matthew Dillon [Sat, 22 Aug 2009 21:07:29 +0000 (14:07 -0700)]
Change TCP_MIN_WINSHIFT from 6 to 5 to accomodate broken firewalls.

* The warning was documented in the FreeBSD syncache code.  Larger window
  scalings will be negotiated if the receive buffer is larger then 2MB.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 22 Aug 2009 20:59:40 +0000 (13:59 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoTCP - Fix problems with dynamic receiver and sender buffer scaling
Matthew Dillon [Sat, 22 Aug 2009 20:53:19 +0000 (13:53 -0700)]
TCP - Fix problems with dynamic receiver and sender buffer scaling

* The receive buffer dynamic scaling ran afoul of our
  avoid_pure_win_update feature.  Correct the calculation so this
  feature properly works when the maximum receive window is smaller
  the maximum sockbuf size.

* Both the send and receive buffer dynamic scaling were limited
  to a maximum TCP window based on the initial window scaling negotiation,
  which in turn is based on the initial size of the receive or send
  sockbuf.

  Negotiate a minimum window scaling of 6 (x64).  This currently limits
  automatic sockbuf expansion to 4MB.  Further refinement is possible
  as long as (1 << scaling) does not exceed 1/4 of the initial sockbuf
  size.

* Reduce the maximum size of sockbuf can be dynamically scaled to from
  16MB to 2MB.  If someone wants more they can sysctl it up higher.

* Disable further scaling once the sockbuf size has exceeded the
  originally negotiated window scale parameters.  There's no gain in
  doing it past that.

14 years agosys/boot: Fix warnings in sys/boot and raise WARNS to 1.
Sascha Wildner [Sat, 22 Aug 2009 19:41:38 +0000 (21:41 +0200)]
sys/boot: Fix warnings in sys/boot and raise WARNS to 1.

This also fixes an error when building with clang.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 22 Aug 2009 00:29:04 +0000 (17:29 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoAMD64 - Fix SIZE_MAX test from previous commit
Matthew Dillon [Sat, 22 Aug 2009 00:28:38 +0000 (17:28 -0700)]
AMD64 - Fix SIZE_MAX test from previous commit

* SIZE_MAX cast to off_t winds up being -1.  Oops.

14 years agoMerge branch 'master' of git://chlamydia.fs.ei.tum.de/dragonfly
Matthias Schmidt [Fri, 21 Aug 2009 12:35:23 +0000 (14:35 +0200)]
Merge branch 'master' of git://chlamydia.fs.ei.tum.de/dragonfly

14 years agoFix typo in development(7)
Matthias Schmidt [Fri, 21 Aug 2009 12:34:43 +0000 (14:34 +0200)]
Fix typo in development(7)

14 years agoAMD64 - Fix compiler warnings.
Matthew Dillon [Fri, 21 Aug 2009 10:45:28 +0000 (03:45 -0700)]
AMD64 - Fix compiler warnings.

14 years agoAMD64 - Refactor the 'top' program.
Matthew Dillon [Fri, 21 Aug 2009 10:44:00 +0000 (03:44 -0700)]
AMD64 - Refactor the 'top' program.

* Ansify pretty much the whole thing.  The 64-bit build simply will break
  and break and break with K&R style declarations.

* Fix misc other issues with curses.

14 years agoAMD64 - Fix compiler warning.
Matthew Dillon [Fri, 21 Aug 2009 10:42:19 +0000 (03:42 -0700)]
AMD64 - Fix compiler warning.

14 years agoAMD64 - AUDIT RUN - Fix format strings, size_t, and other issues
Matthew Dillon [Fri, 21 Aug 2009 10:41:09 +0000 (03:41 -0700)]
AMD64 - AUDIT RUN - Fix format strings, size_t, and other issues

14 years agoAMD64 - yp functions take pointers to int, not pointers to size_t.
Matthew Dillon [Fri, 21 Aug 2009 06:47:48 +0000 (23:47 -0700)]
AMD64 - yp functions take pointers to int, not pointers to size_t.

* yp functions were inconsistent.  Fix numerous compiler warnings.
  Note: FreeBSD made the same changes.

14 years agoAMD64 - Fix compiler warnings
Matthew Dillon [Fri, 21 Aug 2009 06:01:47 +0000 (23:01 -0700)]
AMD64 - Fix compiler warnings

* Also change i_size, which is used with pointer arithmatic, mmap(), and
  munmap(), from off_t to size_t.

14 years agoFix mplock mismatch.
YONETANI Tomokazu [Fri, 21 Aug 2009 02:56:08 +0000 (11:56 +0900)]
Fix mplock mismatch.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 20 Aug 2009 22:31:13 +0000 (15:31 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoAMD64 - Get buildworld working again.
Matthew Dillon [Thu, 20 Aug 2009 22:31:02 +0000 (15:31 -0700)]
AMD64 - Get buildworld working again.

14 years agoacpidump: fix interaction with iasl
Simon Schubert [Thu, 20 Aug 2009 19:56:56 +0000 (21:56 +0200)]
acpidump: fix interaction with iasl

Seems the new iasl puts the disassembly at a different place, so adjust
the way we access its output.

Obtained-from: FreeBSD

14 years agoprintf(1): don't use getopt, second take
Simon Schubert [Thu, 20 Aug 2009 18:21:26 +0000 (20:21 +0200)]
printf(1): don't use getopt, second take

printf must not use getopt, since any passed string is
valid, also strings starting with -, i.e.
printf -f%s oo
has to print "-foo" and not error out with
"illegal option".

However, if printf is passed "--" as an argument separator, we have to
discard it and may not print it.

14 years agoFix numerous compiler warnings and format conversion specifiers.
Matthew Dillon [Thu, 20 Aug 2009 17:24:58 +0000 (10:24 -0700)]
Fix numerous compiler warnings and format conversion specifiers.

14 years agoINET6 - Fix broken call to ip6_notify_pmtu()
Matthew Dillon [Thu, 20 Aug 2009 17:18:44 +0000 (10:18 -0700)]
INET6 - Fix broken call to ip6_notify_pmtu()

14 years agoVKERNEL - fix procedure argument to match prototype.
Matthew Dillon [Thu, 20 Aug 2009 16:32:45 +0000 (09:32 -0700)]
VKERNEL - fix procedure argument to match prototype.

14 years agoRevert "printf(1): don't use getopt"
Matthew Dillon [Thu, 20 Aug 2009 16:28:56 +0000 (09:28 -0700)]
Revert "printf(1): don't use getopt"

This reverts commit 8a65ba3d8f8a805773a99458f6f18f034ad84d57.

printf.c is included by /bin/sh, and the internalized version is
used by apropos which passes it '-- fmt ...'.  FreeBSD and NetBSD
and probably others use getopt().  We have to too or we break --
use.

14 years agodistrib-dirs: replace symlink if it is dangling
Simon Schubert [Thu, 20 Aug 2009 13:02:32 +0000 (15:02 +0200)]
distrib-dirs: replace symlink if it is dangling

The previous version wouldn't work right if a sys symlink existed, but
its target wouldn't.

14 years agolibc: fix declaration: use size_t instead of vm_size_t
Simon Schubert [Thu, 20 Aug 2009 10:51:27 +0000 (12:51 +0200)]
libc: fix declaration: use size_t instead of vm_size_t

14 years agoFinish revert "size_t/ssize_t - change to [unsigned] long"
Simon Schubert [Thu, 20 Aug 2009 08:49:29 +0000 (10:49 +0200)]
Finish revert "size_t/ssize_t - change to [unsigned] long"

- use __uint64_t instead of unsigned long in amd64 for symmetry with i386
- revert ptrdiff_t as well to int, that's what the rest of the world uses

14 years agorc.d/mixer: save state for all /dev/mixer*
Simon Schubert [Thu, 20 Aug 2009 00:41:19 +0000 (02:41 +0200)]
rc.d/mixer: save state for all /dev/mixer*

Recent devfs changes created numbered mixers in /dev.  This commit
allows to save the state of all mixers and also restores them correctly.

14 years agoxargs: error out if argument to -L is no valid number
Simon Schubert [Thu, 20 Aug 2009 00:40:30 +0000 (02:40 +0200)]
xargs: error out if argument to -L is no valid number

14 years agoprintf(1): don't use getopt
Simon Schubert [Thu, 20 Aug 2009 00:24:41 +0000 (02:24 +0200)]
printf(1): don't use getopt

printf must not use getopt, since any passed string is valid, also
strings starting with -, i.e.
printf -f%s oo
has to print "-foo" and not error out with "illegal option".

14 years agoRevert size_t/ssize_t 1e8087d481c6bfecf14ce6eddc5c722031742332
Matthew Dillon [Thu, 20 Aug 2009 08:53:08 +0000 (01:53 -0700)]
Revert size_t/ssize_t 1e8087d481c6bfecf14ce6eddc5c722031742332

Ok, too many issues for i386, we'll go back to using an unsigned int and int
equivalent.

14 years agoHAMMER - Massively improve performance
Matthew Dillon [Thu, 20 Aug 2009 06:30:42 +0000 (23:30 -0700)]
HAMMER - Massively improve performance

* Now that write pipelining is controlled by ip->rsv_recs and now
  that we have write bursting in the BIOQ subsystem, we do not
  actually want to use bawrite() or cluster_write() because the bio
  could end up waiting for the disk for a long time, and it is locked
  for that entire period.  So go back to using bdwrite().

  This seriously improves HAMMER's ability to access files that were
  just written without having to wait for I/O to complete.

* Reclaim (destroy) buffer cache buffers related to UNDO data, except
  for the UNDO block we will be needing again for the next flush.  We
  don't need to keep old undo buffers in the cache!  This improves
  HAMMER's memory footprint.

14 years agoBIOQ - Create a more sophisticated bursting mechanic for writes.
Matthew Dillon [Thu, 20 Aug 2009 06:27:58 +0000 (23:27 -0700)]
BIOQ - Create a more sophisticated bursting mechanic for writes.

* Add sysctls:

  vfs.bioq_reorder_minor_interval
  vfs.bioq_reorder_minor_bytes

  vfs.bioq_reorder_burst_interval
  vfs.bioq_reorder_burst_bytes

* Reads are prioritized over writes.  Every N (minor_interval) reads
  up to (minor_bytes) worth of writes are allowed in order to avoid
  complete write starvation (which is just as bad as complete read
  starvation).

* If a large amount of write data is queued to devices the related
  buffer cache buffers will be locked.  This is not a good place to
  be as any readers trying to access those buffers will then also
  block.

  When the amount of data is excessive the (burst_interval) and
  (burst_bytes) comes into play.  This primarily helps HAMMER
  flush cycles.

* Try to keep vfs.hirunningspace reasonably bounded.  We do not want
  too large a value because of the above buffer locking issue.  On
  the flip side, we can have large numbers of delayed-write dirty buffers
  sitting around because they aren't locked.

* When the buffer cache is hitting hidirtybufspace the buffer daemons
  now try to keep the vfs.runningbufspace at hirunningspace levels
  instead of lorunningspace levels in order to trigger the bioq's
  bursting mode.

14 years agodisklabel64 - Fix DIOCSDINFO64, DIOCWDINFO64 bugs
Matthew Dillon [Thu, 20 Aug 2009 00:22:43 +0000 (17:22 -0700)]
disklabel64 - Fix DIOCSDINFO64, DIOCWDINFO64 bugs

* A loop iterator was using the wrong variable, causing the disklabel
  operation to fail and potentially also (on 64-bit boxes) crashing the
  box.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 20 Aug 2009 00:14:36 +0000 (17:14 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoNATA - Convert sysctls to globals to make NATA compile ok
Matthew Dillon [Thu, 20 Aug 2009 00:14:17 +0000 (17:14 -0700)]
NATA - Convert sysctls to globals to make NATA compile ok

14 years agonewvers.sh: shorten version string
Simon Schubert [Wed, 19 Aug 2009 23:58:31 +0000 (01:58 +0200)]
newvers.sh: shorten version string

The inclusion of the git revision made the version string exceed a
single line, and also mostly duplicated the output.  If we have a git
revision available, use it instead of the standard version string.

Requested-by: dillon@
14 years agogitrev.sh: disable dirty-tree check
Simon Schubert [Wed, 19 Aug 2009 23:38:11 +0000 (01:38 +0200)]
gitrev.sh: disable dirty-tree check

The dirty tree check takes quite long on non-local systems, so disable
it until somebody comes up with a nice solution.

Requested-by: dillon@
14 years agoRemove dev_ops_release() and two more stale prototypes.
Sascha Wildner [Wed, 19 Aug 2009 22:03:28 +0000 (00:03 +0200)]
Remove dev_ops_release() and two more stale prototypes.

Discussed-with: alexh

14 years agoNATA - Replace the queuing algorithm with the one used by bioq.
Matthew Dillon [Wed, 19 Aug 2009 21:49:14 +0000 (14:49 -0700)]
NATA - Replace the queuing algorithm with the one used by bioq.

* NATA doesn't use bioq yet, but I replicated the algorithm to fix the
  read starvation issue.

* Interesting note: Because NATA does not have NCQ reads appear to be
  prioritized even more then they are on AHCI.

14 years agobioqdisksort - refactor I/O queueing to fix read starvation issues.
Matthew Dillon [Wed, 19 Aug 2009 20:59:39 +0000 (13:59 -0700)]
bioqdisksort - refactor I/O queueing to fix read starvation issues.

It is possible to queue several hundred megabytes worth of write I/O's
all at once.  When this occurs, whether we sort the queue or not, reads
wind up getting seriously starved.

Refactor bioqdisksort() to prioritize reads over writes and to also allow
writes to 'leak' into the read space every so often to prevent write
starvation.  The new code is designed to make best use of drive zone caches.

14 years agoHAMMER - Rework write pipelining
Matthew Dillon [Wed, 19 Aug 2009 20:54:29 +0000 (13:54 -0700)]
HAMMER - Rework write pipelining

* Rework write pipelining so it is based on pending direct writes on an
  inode-by-inode basis.  ip->rsv_recs and hmp->rsv_recs are now
  decremented after the direct has completed rather then when the sync
  code has processed the record.

  This fixes serious buffer cache overloading when doing linear writes.

* Implement write clustering or bawrite() calls based on a filesystem
  block getting filled up instead of relying on the buffer cache's bdwrite()
  to keep ahead of the mark.

* vfs.hammer.cluster_enable now effects both read and write clustering.

14 years agoMerge branch 'master' of git://chlamydia.fs.ei.tum.de/dragonfly
Matthias Schmidt [Wed, 19 Aug 2009 17:16:41 +0000 (19:16 +0200)]
Merge branch 'master' of git://chlamydia.fs.ei.tum.de/dragonfly

14 years agopkg_search: Change URLs and honor possible mirror settings
Matthias Schmidt [Wed, 19 Aug 2009 17:12:57 +0000 (19:12 +0200)]
pkg_search: Change URLs and honor possible mirror settings

- Change the version variable to match latest changes on avalon (2.2 ->
  2.2.0)
- If the user uses $BINPKG_SITES or /etc/settings.conf (like with
  pkg_radd) try to download the summary file from a mirror first.  If
  that fails, fall back to default aka avalon

NOTE: If someone changes the directory layout on avalon, please update
the pkg_* tools in base as well.

14 years agoAHCI - Fix interrupt enablement sequencing
Matthew Dillon [Wed, 19 Aug 2009 17:10:41 +0000 (10:10 -0700)]
AHCI - Fix interrupt enablement sequencing

* Interrupt enablement could race port initialization, causing the AHCI
  probe to fail and/or assert.

  Wait for basic port hardware initialization to complete (which is done by
  the port helper threads) before enabling interrupt processing on the chip.

Testing-by: Alexander Polakov <polachok@gmail.com>
14 years agoHAMMER Util - Refactor mount list scan and other fixes
Matthew Dillon [Wed, 19 Aug 2009 15:30:38 +0000 (08:30 -0700)]
HAMMER Util - Refactor mount list scan and other fixes

    * MOUNTCTL - Fix a problem with user mount flags parsing in HAMMER.

    * User mount flags for HAMMER FS was not properly handled. Now
      function vfs_flagstostr() is able to append to the passed buf.

    * Refactor the mountlist scan for info / cleanup commands.

Submitted-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
14 years agoHAMMER rebalance - Fix propogation race.
Matthew Dillon [Wed, 19 Aug 2009 15:26:26 +0000 (08:26 -0700)]
HAMMER rebalance - Fix propogation race.

* It is possible for the mirror_tid in the b-tree node to not be entirely
  updated at the point where a rebalance operation acquires the locks.

14 years agoHAMMER mirroring - Multiple adjustments to support better incremental ops
Matthew Dillon [Wed, 19 Aug 2009 15:23:02 +0000 (08:23 -0700)]
HAMMER mirroring - Multiple adjustments to support better incremental ops

* Read side - Ignore records created after the end point, reducing
  network bandwidth for incremental operations.

* Read side - Generate PASS for records created prior to tid_beg, instead
  of pushing the whole record, reducting network bandwidth for incremental
  operations.

* Write side - Ensure that deletions are end-exclusive.

* Write side - Do not delete records created >= end point, supporting
  incremental operations.

14 years agoahci.4: Fix tunable name (reported by hasso).
Sascha Wildner [Wed, 19 Aug 2009 13:45:41 +0000 (15:45 +0200)]
ahci.4: Fix tunable name (reported by hasso).

14 years agoFix some WARNS fallout from the recent (s)size_t changes.
Sascha Wildner [Wed, 19 Aug 2009 13:38:24 +0000 (15:38 +0200)]
Fix some WARNS fallout from the recent (s)size_t changes.

14 years agosound: add cloning with devfs
Simon Schubert [Wed, 19 Aug 2009 12:12:51 +0000 (14:12 +0200)]
sound: add cloning with devfs

14 years agosys/sys/conf.h - Add GID_TTY #define
Alex Hornung [Wed, 19 Aug 2009 07:41:38 +0000 (08:41 +0100)]
sys/sys/conf.h - Add GID_TTY #define

* Add GID_TTY #define to be able to use GID_TTY comfortably where needed

14 years agoDEVFS - avoid ENOENT on fstat of open vnode; cleanup warning
Alex Hornung [Wed, 19 Aug 2009 10:23:14 +0000 (11:23 +0100)]
DEVFS - avoid ENOENT on fstat of open vnode; cleanup warning

* cleanup warning related to unused variable

* remove accessibility check from getattr() so fstat doesn't
  return ENOENT.

14 years agodistrib-dirs: invert logic
Simon Schubert [Tue, 18 Aug 2009 16:16:50 +0000 (18:16 +0200)]
distrib-dirs: invert logic

If test ! -e sys fails, no ln will be called, but also the return value
of the whole command will be non-zero.  In this make will abort.  Fix
this by inverting the logic, either returning zero from the successful
test -e sys, or returning the return value of the ln -s.

14 years agoKernel - Check cd8/cd9 for root mount (USB)
Matthew Dillon [Wed, 19 Aug 2009 07:34:01 +0000 (00:34 -0700)]
Kernel - Check cd8/cd9 for root mount (USB)

* USB attached CD or DVD drives will attach starting at cd8.  Add cd8 and
  cd9 to the root mount checks when booting -C (which is how CD's boot
  the kernel).

14 years agoAHCI - Fix bricking issue with older chipsets on boot.
Matthew Dillon [Wed, 19 Aug 2009 07:11:31 +0000 (00:11 -0700)]
AHCI - Fix bricking issue with older chipsets on boot.

* It looks like the use of AHCI_PREG_SCTL_DET_DISABLE, which turns off
  the phy on port, can brick the AHCI chip and even take out the entire
  machine.  This seems to effect Intel chips the most.

  Stop using it entirely.

Reports-from: Rumko, Alexander Polakov

14 years agoDEVFS - Avoid clearing of hides that don't come from rules
Alex Hornung [Wed, 19 Aug 2009 07:09:43 +0000 (08:09 +0100)]
DEVFS - Avoid clearing of hides that don't come from rules

* Avoid clearing hides that didn't come from rules by introducing a
  new node flag, DEVFS_RULE_HIDDEN.

* Reactivate hiding of ptm/ and all its contents for cleaner unix98
  ptys.

14 years agoDEVFS - fix possible panic on devfs_release_ops
Alex Hornung [Tue, 18 Aug 2009 22:24:42 +0000 (23:24 +0100)]
DEVFS - fix possible panic on devfs_release_ops

* under certain conditions on unloading a module it could happen that
  the memory containing the dev_ops was released before devfs_release_
  ops could happen due to the asynchronous nature of destroy_dev.
  Fix this saving only a pointer to the ops and not using it to store
  anything but rather use a local tailq for reference counting the
  dev_ops.

14 years agoAMD64 - Pipes now support 64 bit size_t for uio_resid.
Matthew Dillon [Wed, 19 Aug 2009 04:36:25 +0000 (21:36 -0700)]
AMD64 - Pipes now support 64 bit size_t for uio_resid.

* Fix bugs on 64-bit kernels related to reads and writes on pipes
  which specify IO sizes in excess of 2G.

* Add a signal check and break in the loop for any pipe read or write
  greater then 10MB.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 19 Aug 2009 04:07:27 +0000 (21:07 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoHAMMER - break atomicy for huge reads and writes.
Matthew Dillon [Wed, 19 Aug 2009 04:06:23 +0000 (21:06 -0700)]
HAMMER - break atomicy for huge reads and writes.

* Allow reads or writes in excess of 100MB to be interrupted.  Otherwise
  it is a simple matter to DOS the machine into oblivion.

  And if you think it could be bad on a 32 bit machine, just think what
  can happen on a 64-bit machine with a multi-terrabyte address space!

14 years agoAMD64 - Refactor uio_resid and size_t assumptions.
Matthew Dillon [Wed, 19 Aug 2009 03:30:09 +0000 (20:30 -0700)]
AMD64 - Refactor uio_resid and size_t assumptions.

* uio_resid changed from int to size_t (size_t == unsigned long equivalent).

* size_t assumptions in most kernel code has been refactored to operate in a
  64 bit environment.

* In addition, the 2G limitation for VM related system calls such as mmap()
  has been removed in 32 bit environments.  Note however that because
  read() and write() return ssize_t, these functions are still limited
  to a 2G byte count in 32 bit environments.

14 years agoChange typedefs for vm_offset_t, vm_size_t, and vm_pindex_t, add szmin/sz/max
Matthew Dillon [Wed, 19 Aug 2009 03:01:13 +0000 (20:01 -0700)]
Change typedefs for vm_offset_t, vm_size_t, and vm_pindex_t, add szmin/sz/max

* Generally change these types from unsigned int to unsigned long in
  order to better catch int/long issues on both 32 and 64 bit builds.

* Add szmin() and szmax() inlines which take and return size_t.

14 years agoFix miscellanious size_t related compiler warnings.
Matthew Dillon [Wed, 19 Aug 2009 02:59:59 +0000 (19:59 -0700)]
Fix miscellanious size_t related compiler warnings.

14 years agosize_t/ssize_t - change to [unsigned] long
Matthew Dillon [Wed, 19 Aug 2009 02:56:17 +0000 (19:56 -0700)]
size_t/ssize_t - change to [unsigned] long

* change size_t from unsigned int to unsigned long, and change ssize_t
  from int to long for both 32 and 64 bit builds.

  NOTE: This may not last for 32 bit builds, depending on what it breaks
  in pkgsrc land, but the change makes it easier to detect 32/64 bit
  issues with size_t, sizeof, and pointer arithmatic on 32 bit machines.

14 years agotest/amd64: increase qemu opcode buffer limits
Simon Schubert [Sun, 16 Aug 2009 23:43:08 +0000 (01:43 +0200)]
test/amd64: increase qemu opcode buffer limits

qemu 0.10.6 segfaults with the standard opcode buffer limits, so we have
to increase them a bit to make it work.

14 years agotest/amd64: update to qemu-0.10.6
Simon Schubert [Sun, 16 Aug 2009 17:24:40 +0000 (19:24 +0200)]
test/amd64: update to qemu-0.10.6