dragonfly.git
16 months agovkernel - Add machdep.wall_cmos_clock sysctl.
Antonio Huete Jimenez [Mon, 26 Nov 2012 23:14:14 +0000 (00:14 +0100)]
vkernel - Add machdep.wall_cmos_clock sysctl.

Programs that rely on this sysctl won't exit due its absence
and they will consider CMOS doesn't keep the local time.
Note the sysctl is read-only so programs like adjkerntz(8)
won't be able to change it.

16 months agoinstaller: Fix handling of CMOS set to UTC vs. CMOS set to wall time.
Sascha Wildner [Mon, 26 Nov 2012 18:39:57 +0000 (19:39 +0100)]
installer: Fix handling of CMOS set to UTC vs. CMOS set to wall time.

It was reversed in the installer (compared to tzsetup(8)).

/etc/wall_cmos_clock needs to be created when the CMOS is set to the
time of the clock on the wall. While here, also add removing the file
in case the user selects 'CMOS set to UTC'. This is if he chose the
other setting previously and then tried again.

Reported-by: many
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/39>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2060>

16 months agopolling: Increase default status polling fraction to 80
Sepherosa Ziehau [Mon, 26 Nov 2012 13:41:20 +0000 (21:41 +0800)]
polling: Increase default status polling fraction to 80

Before we bumped the polling frequency from 1000 to 2000, the status
polling fraction was 20; keep the original ratio.

16 months agobce: Commit coalesce parameters changes in polling code
Sepherosa Ziehau [Mon, 26 Nov 2012 13:38:48 +0000 (21:38 +0800)]
bce: Commit coalesce parameters changes in polling code

16 months agobce: Improve tiny packets transmission performance on low frequency CPU
Sepherosa Ziehau [Mon, 26 Nov 2012 13:32:42 +0000 (21:32 +0800)]
bce: Improve tiny packets transmission performance on low frequency CPU

Update TX HOST_IDX and HOST_BSEQ registers a little bit often; mainly to
improve timeliness of packets transmission:
The TX HOST_IDX and HOST_BSEQ registers are updated after certain amount
of TX descriptors are added to the hardware TX ring.  The default value
of the amount of TX descriptors are 8.  This value could be further
tuned by per-device sysctl node hw.bceX.tx_wreg.

The default value greatly improves tiny packets transmission performance
w/ 5709C on AMD970@800Mhz (513Kpps -> 1Mpps) and it does not increase CPU
usage on AMD970@3500Mhz (CPU usage stays @24%, 5709C could only do 1Mpps).

16 months agobce: Don't mess w/ MQ_COMMAND on TX path; it seems useless
Sepherosa Ziehau [Sun, 25 Nov 2012 12:57:57 +0000 (20:57 +0800)]
bce: Don't mess w/ MQ_COMMAND on TX path; it seems useless

Tested-with: 5706C, 5708C and 5709C

16 months agobce: Reformat comment in bce_npoll_compat a little bit
Sepherosa Ziehau [Sun, 25 Nov 2012 11:00:50 +0000 (19:00 +0800)]
bce: Reformat comment in bce_npoll_compat a little bit

16 months agoigb: Use SYSCTL_ADD_INT for hw.igbX.tx_wreg_nsegs
Sepherosa Ziehau [Sun, 25 Nov 2012 06:35:31 +0000 (14:35 +0800)]
igb: Use SYSCTL_ADD_INT for hw.igbX.tx_wreg_nsegs

It actually does not have any constraints.

16 months agoemx: Use SYSCTL_ADD_INT for hw.emxX.wreg_tx_nsegs
Sepherosa Ziehau [Sun, 25 Nov 2012 06:34:21 +0000 (14:34 +0800)]
emx: Use SYSCTL_ADD_INT for hw.emxX.wreg_tx_nsegs

It actually does not have any constraints.

16 months agobnx: Improve tiny packets transmission performance on low frequency CPU
Sepherosa Ziehau [Sun, 25 Nov 2012 06:08:31 +0000 (14:08 +0800)]
bnx: Improve tiny packets transmission performance on low frequency CPU

- Reduce TX coalesce BDs from 128 to 64.  This improves tiny packets
  transmission performance on AMD970@2200Mhz a little bit (1.40Mpps
  -> 1.48Mpps)
- Update TX PROD register a little bit often; mainly to improve timeliness
  of packets transmission:
  The TX PROD register is updated after certain amount of TX descriptors
  are added to the hardware TX ring.  The default value of the amount of
  TX descriptors are 8.  This value could be further tuned by per-device
  sysctl node hw.bnxX.tx_wreg.  The default value greatly improves tiny
  packets performance on AMD970@800Mhz (780Kpps -> 1.11Mpps) and it does
  not increase CPU usage on AMD970@3500Mhz (CPU usage stays @31%).

16 months agobnx: Commit coalesce parameters changes in polling code
Sepherosa Ziehau [Sat, 24 Nov 2012 13:24:14 +0000 (21:24 +0800)]
bnx: Commit coalesce parameters changes in polling code

16 months agokernel: Remove some code that does nothing.
Sascha Wildner [Sat, 24 Nov 2012 23:13:20 +0000 (00:13 +0100)]
kernel: Remove some code that does nothing.

16 months agoFix some typos (unknow -> unknown).
Sascha Wildner [Sat, 24 Nov 2012 22:14:45 +0000 (23:14 +0100)]
Fix some typos (unknow -> unknown).

16 months agousb4bsd: Initial round of build fixes for serial drivers.
Sascha Wildner [Sat, 24 Nov 2012 20:35:21 +0000 (21:35 +0100)]
usb4bsd: Initial round of build fixes for serial drivers.

Not hooked into the build because some things are still missing,
most importantly ucom(4) porting.

16 months agondis(4): Bring in some fixes from FreeBSD.
Sascha Wildner [Sat, 24 Nov 2012 20:11:30 +0000 (21:11 +0100)]
ndis(4): Bring in some fixes from FreeBSD.

16 months agondis(4): Make NDIS compile with usb4bsd too.
Sascha Wildner [Sat, 24 Nov 2012 20:22:55 +0000 (21:22 +0100)]
ndis(4): Make NDIS compile with usb4bsd too.

However, testing results are pretty much as modest as with the old USB
stack. Maybe someone else has more luck.

New files taken from FreeBSD.

16 months agousb4bsd: Fix buildkernel with device usb4bsd.
Sascha Wildner [Fri, 23 Nov 2012 18:46:19 +0000 (19:46 +0100)]
usb4bsd: Fix buildkernel with device usb4bsd.

16 months agowpa_supplicant.8: Document all options.
Sascha Wildner [Fri, 23 Nov 2012 18:11:29 +0000 (19:11 +0100)]
wpa_supplicant.8: Document all options.

Reported-by: Max Herrgard <herrgard@gmail.com>
Taken-from:  FreeBSD

16 months agowpa_supplicant.conf.5: Fix section order.
Sascha Wildner [Fri, 23 Nov 2012 18:02:53 +0000 (19:02 +0100)]
wpa_supplicant.conf.5: Fix section order.

16 months agoVFS quota: hpfs is now read-only, remove support
François Tigeot [Fri, 23 Nov 2012 06:57:26 +0000 (07:57 +0100)]
VFS quota: hpfs is now read-only, remove support

16 months agoDocumentation: unrhdr to idr conversion
François Tigeot [Mon, 19 Nov 2012 09:30:34 +0000 (10:30 +0100)]
Documentation: unrhdr to idr conversion

17 months agovkernel: Make "options IPX" compilable into the vkernel.
Sascha Wildner [Thu, 22 Nov 2012 19:44:23 +0000 (20:44 +0100)]
vkernel: Make "options IPX" compilable into the vkernel.

Usage of "errno" in userspace as a variable name results in sad code.
Rename them to "error" instead.

Reported-by: tuxillo
17 months agokernel: Remove some NULL checks after kmalloc(..., M_WAITOK).
Sascha Wildner [Thu, 22 Nov 2012 17:27:14 +0000 (18:27 +0100)]
kernel: Remove some NULL checks after kmalloc(..., M_WAITOK).

17 months agokernel: Use M_ZERO instead of bzero()ing.
Sascha Wildner [Thu, 22 Nov 2012 17:24:47 +0000 (18:24 +0100)]
kernel: Use M_ZERO instead of bzero()ing.

17 months agoah[cd](4): Clean up some #ifdefs so it's clearer what we are doing.
Sascha Wildner [Thu, 22 Nov 2012 16:41:11 +0000 (17:41 +0100)]
ah[cd](4): Clean up some #ifdefs so it's clearer what we are doing.

17 months agoemx: Don't update TDT upon very packets transmitted
Sepherosa Ziehau [Thu, 22 Nov 2012 12:53:36 +0000 (20:53 +0800)]
emx: Don't update TDT upon very packets transmitted

The TDT is updated only after certain amount of TX descriptors are
added to the hardware TX ring.  The default value of the amount of
TX descriptors are 8.  This value could be further tuned by per-device
sysctl node hw.emxX.tx_wreg_nsegs.

CPU usage when transmitting 18bytes tiny UDP datagrams @1.48Mpps with
82571 on AMD970 (3500Mhz) are reduced from 50% to 30% with the default
value.

Inspired-by: FreeBSD netmap's paper
17 months agoigb: Don't update TDT upon very packets transmitted
Sepherosa Ziehau [Thu, 22 Nov 2012 12:02:31 +0000 (20:02 +0800)]
igb: Don't update TDT upon very packets transmitted

The TDT is updated only after certain amount of TX descriptors are
added to the hardware TX ring.  The default value of the amount of
TX descriptors are 8.  This value could be further tuned by per-device
sysctl node hw.igbX.tx_wreg_nsegs.

CPU usage when transmitting 18bytes tiny UDP datagrams @1.48Mpps with
82575 on AMD970 (3500Mhz) are reduced from 55% to 38% with the default
value.

Inspired-by: FreeBSD netmap's paper
17 months agopktgen: Rework to improve performance using low CPU frequency
Sepherosa Ziehau [Sat, 17 Nov 2012 10:07:21 +0000 (18:07 +0800)]
pktgen: Rework to improve performance using low CPU frequency

The performance improvement is measured on AMD970 operating at 800Mhz
w/ Intel 82575 NIC using 18bytes UDP datagrams.

- Don't refill and allocate new packets for each transmission, instead
  a set of pregenerated packets are used.
- Use NIC driver's "txeof" to tick out more packets instead of bindly
  trying to inject more packets into NIC's TX ring.

These above two modifications give me ~200Kpps (710Kpps -> 910Kpps)
transmission rate improvement.

- Don't use hardware TX checksum offloading feature.  Since the set of
  packets to be used are pregenerated, this will not hurt performance,
  instead, this could improve performance on certain hardwares, e.g.
  Intel's NIC chipsets which require additional TX descriptor for setting
  up hardware TX checksum offload context.

The above modification give me additional ~40Kpps transmission rate
improvement.

17 months agohpfs - Fix a couple panics and a little cleanup.
Antonio Huete Jimenez [Thu, 22 Nov 2012 10:47:58 +0000 (11:47 +0100)]
hpfs - Fix a couple panics and a little cleanup.

* Fix compilation with HPFS_DEBUG.

* Fix a panic due CNP_PDIRUNLOCK flag not being cleared.

* Fix a panic where returned vnode after a lookup is not
  NULL in the ENOENT case.

* Disable write support completely. It was pretty minimal
  and operations like create or rename were not supported.

It has been tested with a filesystem created by OS/2 Warp 2.1.
Copying data out of it worked fine, but there is still an
outstanding issue with overlapping buffers.

17 months agokernel - Fix NFS panic when competing clients collide on hardlink
Matthew Dillon [Wed, 21 Nov 2012 17:59:55 +0000 (09:59 -0800)]
kernel - Fix NFS panic when competing clients collide on hardlink

* Fix recursive execlusive lock on vnode.

* For example, if several boxes are nfs booting and have the same writable
  /var/log, simultanious attempts to rotate logs can cause a panic due to
  higher layers of the OS's hardlink code not being able to detect
  duplicate vnodes which are created by some other client racing the same
  operation.

* Adds CNP_NOTVP and cn_notvp flag which vop_compat_nlink() uses to notify
  NFS's VOP_LOOKUP function to check for a vnode lookup collision.

-Matt

17 months agoRemove some duplicated semicolons (mostly in the kernel).
Sascha Wildner [Wed, 21 Nov 2012 17:13:43 +0000 (18:13 +0100)]
Remove some duplicated semicolons (mostly in the kernel).

17 months agohptiop(4): Add support for RocketRAID 4520 and 4522.
Sascha Wildner [Wed, 21 Nov 2012 03:26:47 +0000 (04:26 +0100)]
hptiop(4): Add support for RocketRAID 4520 and 4522.

This adds support for HighPoint's recent 6Gb/s SAS/SATA RAID cards.

It's not tested in DragonFly, unfortunately, due to lack of hardware,
but I'm confident. :)

Taken-from: FreeBSD

17 months agoigb: Dispatch callout to the CPU that is checking status
Sepherosa Ziehau [Tue, 20 Nov 2012 12:26:52 +0000 (20:26 +0800)]
igb: Dispatch callout to the CPU that is checking status

This reduces sporadic contentions on the main serializer.

17 months agoaac(4): Add a missing unlock.
Sascha Wildner [Tue, 20 Nov 2012 05:23:49 +0000 (06:23 +0100)]
aac(4): Add a missing unlock.

17 months agoiir(4): Clean up some unused code.
Sascha Wildner [Tue, 20 Nov 2012 04:32:38 +0000 (05:32 +0100)]
iir(4): Clean up some unused code.

17 months agoext2fs - Clear CNP_PDIRUNLOCK flag after a lookup.
Antonio Huete Jimenez [Mon, 19 Nov 2012 22:32:16 +0000 (23:32 +0100)]
ext2fs - Clear CNP_PDIRUNLOCK flag after a lookup.

vop_compat_nresolve() unlocks the vnode when flag CNP_PDIRUNLOCK
is set, so either we clear the flag or avoid unlocking the vnode
after an ext2_lookup().

DragonFly-bug: http://bugs.dragonflybsd.org/issues/2454

Reported by: Skylar Hawk

17 months agoUnbreak buildworld.
Sascha Wildner [Mon, 19 Nov 2012 17:56:42 +0000 (18:56 +0100)]
Unbreak buildworld.

Reported-by: marino
17 months ago/usr/Makefile: Add pkgsrc-create-shallow option
John Marino [Mon, 19 Nov 2012 17:43:52 +0000 (18:43 +0100)]
/usr/Makefile: Add pkgsrc-create-shallow option

17 months agomake distribution: Remove some symlinks before (re-)creating them.
Sascha Wildner [Mon, 19 Nov 2012 16:59:05 +0000 (17:59 +0100)]
make distribution: Remove some symlinks before (re-)creating them.

Reported-by: marino
17 months agonetstat: Make netstat -rn more resilient to having the routing table changing
Sepherosa Ziehau [Mon, 19 Nov 2012 09:51:24 +0000 (17:51 +0800)]
netstat: Make netstat -rn more resilient to having the routing table changing

Obtained-from: FreeBSD 176289 by jhb
  "Make netstat -rn more resilient to having the routing table change out from
   under it while running.  Note that this is still not perfect:
   - Try to do something intelligent if kvm_read() fails to read a routing
     table structure such as an rtentry, radix_node, or ifnet.
   - Don't follow left and right node pointers in radix_nodes unless
     RNF_ACTIVE is set in rn_flags.  This avoids walking through freed
     radix_nodes."

17 months agomchian: Sync w/ FreeBSD a little bit
Sepherosa Ziehau [Mon, 19 Nov 2012 09:38:44 +0000 (17:38 +0800)]
mchian: Sync w/ FreeBSD a little bit

subr_mchain.c CVS 1.{6, 8, 9, 10, 16, 18}

Submitted-by: Alexey Slynko w/ modification by me
DragonFly-bug: http://bugs.dragonflybsd.org/issues/80

17 months agoPorting: Document a callout_drain() replacement
François Tigeot [Mon, 19 Nov 2012 08:48:47 +0000 (09:48 +0100)]
Porting: Document a callout_drain() replacement

17 months agokernel: Move DEVICE_POLLING to the bottom of 'options'.
Sascha Wildner [Sun, 18 Nov 2012 21:35:11 +0000 (22:35 +0100)]
kernel: Move DEVICE_POLLING to the bottom of 'options'.

17 months agokernel: Remove unused KTR_POLLING option.
Sascha Wildner [Sun, 18 Nov 2012 21:34:36 +0000 (22:34 +0100)]
kernel: Remove unused KTR_POLLING option.

17 months agompt(4): Fix a panic in RAID operation.
Sascha Wildner [Sun, 18 Nov 2012 19:46:15 +0000 (20:46 +0100)]
mpt(4): Fix a panic in RAID operation.

I ported it wrongly. FreeBSD uses callout_init_mtx() here.

17 months agodehumanize_number(3): Add T, P and E suffix support.
Sascha Wildner [Sat, 17 Nov 2012 21:58:30 +0000 (22:58 +0100)]
dehumanize_number(3): Add T, P and E suffix support.

Reported-by: ftigeot
17 months agomtree: Do no longer create /usr/include/objc.
Sascha Wildner [Sat, 17 Nov 2012 12:47:14 +0000 (13:47 +0100)]
mtree: Do no longer create /usr/include/objc.

17 months agoRemove an unused header.
Sascha Wildner [Sat, 17 Nov 2012 01:59:23 +0000 (02:59 +0100)]
Remove an unused header.

17 months agoClean up references to some obsolete functions in manual pages.
Sascha Wildner [Fri, 16 Nov 2012 23:49:42 +0000 (00:49 +0100)]
Clean up references to some obsolete functions in manual pages.

sigpause(2)               -> sigsuspend(2)
sigsetmask(2)/sigblock(2) -> sigprocmask(2)
sigvec(2)                 -> sigaction(2)
alarm(3)                  -> setitimer(2)
pause(3)                  -> sigsuspend(2)

Based on similar changes in FreeBSD.

17 months agovfork.2: Document that vfork(2) returns pid_t.
Sascha Wildner [Fri, 16 Nov 2012 17:19:02 +0000 (18:19 +0100)]
vfork.2: Document that vfork(2) returns pid_t.

Also adjust syscalls.master but it actually doesn't matter. These
adjustments are merely of a cosmetic nature.

17 months agonrelease/Makefile.usr: Relocate the git gc for pkgsrc to nrelease.
Sascha Wildner [Fri, 16 Nov 2012 13:51:11 +0000 (14:51 +0100)]
nrelease/Makefile.usr: Relocate the git gc for pkgsrc to nrelease.

Since it was only meant for keeping the LiveDVD smaller, put it into
its build and don't force everyone to sit through it. The time it
takes seems to increase significantly on virtual machines with just
1G of RAM, for example. It seems to be quite memory hungry.

Reported-by: many
17 months agocp(1)/mv(1): Bring back a number of cleanups we did previously.
Sascha Wildner [Fri, 16 Nov 2012 12:19:38 +0000 (13:19 +0100)]
cp(1)/mv(1): Bring back a number of cleanups we did previously.

People (including myself) have put their time and thought into
this in the past, so we don't want this simply papered over with
the previous state.

17 months agoFix buildworld.
Sascha Wildner [Fri, 16 Nov 2012 12:13:45 +0000 (13:13 +0100)]
Fix buildworld.

mv(1) is a bootstrap tool, hence it needs to build with host includes.

17 months agoUpdate the pciconf(8) database.
Sascha Wildner [Fri, 16 Nov 2012 10:42:05 +0000 (11:42 +0100)]
Update the pciconf(8) database.

November 14, 2012 snapshot from http://pciids.sourceforge.net/

17 months ago/bin/mv: Sync with FreeBSD
John Marino [Fri, 16 Nov 2012 09:21:09 +0000 (10:21 +0100)]
/bin/mv: Sync with FreeBSD

1. Utilize central <paths.h> header
2. Meet posix spec for moving directory to existing non-empty directory
3. Meet posix spec for not moving directory over a file
4. Don't chop IO into pieces, use MAXPHYS
5. Add -h flag (similar to ln -h flag)
6. Test for input_is_terminal
7. Regression test added.

DETAILS
==========================================================================
1. remove pathnames.h file and add _PATH_RM to paths.h
2. Moving a directory to an existing non-empty directory will now fail as
   required.
3. Prior to change this test past, but after change it failed on
   cross-link devices.  Original code added to check for case and return
   -1 for the cross-link case.
4. Read files in one block and improve warn messages.
5. Using -h flag will force mv to treat a symbolic link to a directory
   for the target as a symbolic link instead of a directory.  This makes
   it possible to atomically update a symbolic link using rename().
6. POSIX requires this behavior:
   if (exists and (NOT f_options) AND
     ((not_writable AND input_is_terminal) OR i_option)) then
     prompt
   This behavior was implemented.
7. Passes all tests in suite.  Prior to change it failed 2 of 32 tests.

17 months agoUPDATING: Mention DEVICE_POLLING is replaced by IFPOLL_ENABLE
Sepherosa Ziehau [Fri, 16 Nov 2012 08:59:53 +0000 (16:59 +0800)]
UPDATING: Mention DEVICE_POLLING is replaced by IFPOLL_ENABLE

17 months agopolling: Remove device_polling remainder
Sepherosa Ziehau [Fri, 16 Nov 2012 08:56:19 +0000 (16:56 +0800)]
polling: Remove device_polling remainder

DEVICE_POLLING has no effect since this commit and will be nuked
after next release.

17 months agopolling: Remove device_polling support
Sepherosa Ziehau [Fri, 16 Nov 2012 08:36:05 +0000 (16:36 +0800)]
polling: Remove device_polling support

17 months agofirewire: Mention IFPOLL_ENABLE instead of DEVICE_POLLING
Sepherosa Ziehau [Fri, 16 Nov 2012 08:35:32 +0000 (16:35 +0800)]
firewire: Mention IFPOLL_ENABLE instead of DEVICE_POLLING

17 months agoconfig: Remove device_polling from stock configures
Sepherosa Ziehau [Fri, 16 Nov 2012 07:50:46 +0000 (15:50 +0800)]
config: Remove device_polling from stock configures

17 months agopolling: Update manpage for device_polling to ifpoll switching
Sepherosa Ziehau [Fri, 16 Nov 2012 07:46:01 +0000 (15:46 +0800)]
polling: Update manpage for device_polling to ifpoll switching

17 months agowpi: This driver never supported polling
Sepherosa Ziehau [Fri, 16 Nov 2012 06:05:59 +0000 (14:05 +0800)]
wpi: This driver never supported polling

17 months agoiwn: This driver never supported polling
Sepherosa Ziehau [Fri, 16 Nov 2012 06:05:33 +0000 (14:05 +0800)]
iwn: This driver never supported polling

17 months ago/bin/rm: fix removing symlinks with uchg/uappnd set
John Marino [Thu, 15 Nov 2012 23:31:35 +0000 (00:31 +0100)]
/bin/rm: fix removing symlinks with uchg/uappnd set

One error case described in FreeBSD PR bin/111226:
  /bin/rm when running as super user and failing to unlink a
  UF_APPEND|UF_IMMUTABLE protected symbolic link will reset the
  UF_APPEND and UF_IMMUTABLE flags on the symbolic link's target (if
  that target exists) - an object that /bin/rm should not touch! (Quote
  from SUSv3: "The rm utility removes symbolic links themselves, not
  the files they refer to, as a consequence of the dependence on the
  unlink() functionality").

There was a failure case for /usr/bin/find as well, but swildner
recently synchronized find with FreeBSD and fixed that one.

Taken-from: FreeBSD SVN 193087 (30 MAY 2009)

17 months agolibc/fts: Use O_CLOEXEC for internal file descriptors
John Marino [Thu, 15 Nov 2012 21:46:29 +0000 (22:46 +0100)]
libc/fts: Use O_CLOEXEC for internal file descriptors

Because fts keeps internal file descriptors open across calls, making such
descriptors close-on-exec helps not only multi-threaded applications but
also single-threaded applications.

In particular, this prevents passing a temporary file descriptor for saving
the current directory to processes created via find -exec.

Taken-from: FreeBSD SVN 241010 (27 SEP 2012)

17 months agobug 2443: bin/cp: sync with FreeBSD (bug fixes + new options)
John Marino [Thu, 15 Nov 2012 20:57:01 +0000 (21:57 +0100)]
bug 2443: bin/cp: sync with FreeBSD (bug fixes + new options)

* Fix FTS_NOCHDIR behavior on empty directory.
* Add -a option (archive mode, equivalent to -RpP)
* Add -l option (create hard links instead of copying)
* Add -x option (FS mount points are not traversed)
* Preserve file flags on symlinks on cp -Rp
* Don't copy socket anyway after "xxx is a socket (not copied)"
* Avoid division-by-zero situations
* make -r synonym for -R but maintain -r behavior with -L

Taken-from: FreeBSD (multiple commits)
https://bugs.dragonflybsd.org/issues/2443

17 months agokernel - Fix off-by-1 error in semexit
Matthew Dillon [Thu, 15 Nov 2012 20:30:51 +0000 (12:30 -0800)]
kernel - Fix off-by-1 error in semexit

* Fix an off-by-1 error that was preventing semexit from properly undoing
  all the semaphores controlled by the exiting process.

Reported-by: lentferj, vsrinivas, others
17 months agoshare/misc/gdbinit - New function lstdtok
Antonio Huete Jimenez [Thu, 15 Nov 2012 19:13:03 +0000 (20:13 +0100)]
share/misc/gdbinit - New function lstdtok

- List tokens for a specified thread.

17 months agoinit(8): Resurrect kern.shutdown_timeout as kern.init_shutdown_timeout.
Sascha Wildner [Wed, 14 Nov 2012 22:57:04 +0000 (23:57 +0100)]
init(8): Resurrect kern.shutdown_timeout as kern.init_shutdown_timeout.

Taken from FreeBSD. Quoting their commit msg:

Fix system shutdown timeout handling by again supporting longer running
shutdown procedures (which have a duration of more than 120 seconds).

We have two user-space affecting shutdown timeouts: a "soft" one in
/etc/rc.shutdown and a "hard" one in init(8). The first one can be
configured via /etc/rc.conf variable "rcshutdown_timeout" and defaults
to 30 seconds. The second one was originally (in 1998) intended to be
configured via sysctl(8) variable "kern.shutdown_timeout" and defaults
to 120 seconds.

Unfortunately, the "kern.shutdown_timeout" was declared "unused" in 1999
(as it obviously is actually not used within the kernel itself) and
hence was intentionally but misleadingly removed in revision 1.107 from
init_main.c. Kernel sysctl(8) variables are certainly a wrong way to
control user-space processes in general, but in this particular case the
sysctl(8) variable should have remained as it supports init(8), which
isn't passed command line flags (which in turn could have been set via
/etc/rc.conf), etc.

As there is already a similar "kern.init_path" sysctl(8) variable which
directly affects init(8), resurrect the init(8) shutdown timeout under
sysctl(8) variable "kern.init_shutdown_timeout". But this time document
it as being intentionally unused within the kernel and used by init(8).
Also document it in the manpages init(8) and rc.conf(5).

17 months agolibk{core,info}: The kern.ccpu sysctl is gone, so remove *get_sched_ccpu().
Sascha Wildner [Wed, 14 Nov 2012 22:14:32 +0000 (23:14 +0100)]
libk{core,info}: The kern.ccpu sysctl is gone, so remove *get_sched_ccpu().

Interestingly, kcore_get_sched_ccpu() seems to never have returned ccpu,
but instead tk_nin, which is not related.

17 months agotop(1): Remove some code that is unused after the UP removal.
Sascha Wildner [Wed, 14 Nov 2012 21:24:23 +0000 (22:24 +0100)]
top(1): Remove some code that is unused after the UP removal.

17 months ago<sys/proc.h>: Adjust the names of two unused bits to use bit numbering.
Sascha Wildner [Wed, 24 Oct 2012 19:20:36 +0000 (21:20 +0200)]
<sys/proc.h>: Adjust the names of two unused bits to use bit numbering.

17 months agomount{,_ufs}: Fix wrong mountctl(2) error check.
Sascha Wildner [Wed, 14 Nov 2012 10:06:26 +0000 (11:06 +0100)]
mount{,_ufs}: Fix wrong mountctl(2) error check.

mountctl(2) returns the number of copied bytes when successful, and -1
if there was an error. This prevented ", local" from being printed in
mount output.

Reported-by: YONETANI Tomokazu
17 months agoSync zoneinfo database with tzdata2012j from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Tue, 13 Nov 2012 18:41:51 +0000 (19:41 +0100)]
Sync zoneinfo database with tzdata2012j from ftp://ftp.iana.org/tz/releases

* africa: Lybia set their time one hour back at 02:00 on November 10
    (last Saturday).

* Additional miscellaneous fixes in various comments.

17 months agotzfile.5: Little wording fix (from tzcode2012j).
Sascha Wildner [Tue, 13 Nov 2012 18:39:40 +0000 (19:39 +0100)]
tzfile.5: Little wording fix (from tzcode2012j).

17 months agoipcs(1): Fix the "ipcs: kvm_nlist: No such file or directory" error.
Sascha Wildner [Tue, 13 Nov 2012 17:35:17 +0000 (18:35 +0100)]
ipcs(1): Fix the "ipcs: kvm_nlist: No such file or directory" error.

The "semu" variable was removed in 79757ed082, causing this breakage.
Strangely, even before its removal it wasn't used for anything in
ipcs(1).

Reported-by: beket
17 months agoipcs(8): Raise WARNS to 6.
Sascha Wildner [Tue, 13 Nov 2012 17:13:30 +0000 (18:13 +0100)]
ipcs(8): Raise WARNS to 6.

17 months agoReally fix systat(1).
Sascha Wildner [Mon, 12 Nov 2012 20:59:30 +0000 (21:59 +0100)]
Really fix systat(1).

17 months agoifconfig: Deprecate "pollcpu" and make "polling" same as "polling"
Sepherosa Ziehau [Mon, 12 Nov 2012 12:34:39 +0000 (20:34 +0800)]
ifconfig: Deprecate "pollcpu" and make "polling" same as "polling"

17 months agofwe: Switch from device_polling to ifpoll
Sepherosa Ziehau [Mon, 12 Nov 2012 12:21:31 +0000 (20:21 +0800)]
fwe: Switch from device_polling to ifpoll

17 months agosystat - Do not use ccpu for %cpu calculation in pigs view.
Antonio Huete Jimenez [Sun, 11 Nov 2012 23:18:01 +0000 (00:18 +0100)]
systat - Do not use ccpu for %cpu calculation in pigs view.

- ccpu went away after the new scheduler work so sync with
  the current status of the kernel.
- Also remove all the unused kvm* stuff and get fscale via sysctl.

Reported-by: tpchin <tpchin@telstra.com>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2245>

17 months agoRemove an ancient file that is no longer used.
Sascha Wildner [Sun, 11 Nov 2012 20:51:34 +0000 (21:51 +0100)]
Remove an ancient file that is no longer used.

17 months agoloader: Detect SMBIOS and export its information into the environment.
Sascha Wildner [Sun, 11 Nov 2012 11:30:20 +0000 (12:30 +0100)]
loader: Detect SMBIOS and export its information into the environment.

Useful to check motherboard vendor/version, BIOS version and so forth.
Use kenv(1) for viewing the information.

This information can be accessed from the kernel but should only be
as a last resort.

Might also help in the future to better detect virtual machine types.

Taken-from: FreeBSD

17 months agovge: Switch from device_polling to ifpoll
Sepherosa Ziehau [Sun, 11 Nov 2012 11:10:50 +0000 (19:10 +0800)]
vge: Switch from device_polling to ifpoll

17 months agonge: Switch from device_polling to ifpoll
Sepherosa Ziehau [Sun, 11 Nov 2012 10:20:17 +0000 (18:20 +0800)]
nge: Switch from device_polling to ifpoll

17 months agodc: Add missing ifpoll_compat_setup
Sepherosa Ziehau [Sun, 11 Nov 2012 09:44:04 +0000 (17:44 +0800)]
dc: Add missing ifpoll_compat_setup

17 months agodc: Switch from device_polling to ifpoll
Sepherosa Ziehau [Sun, 11 Nov 2012 09:29:24 +0000 (17:29 +0800)]
dc: Switch from device_polling to ifpoll

17 months agohammer.8: Add back an .El that was removed by mistake.
Sascha Wildner [Sun, 11 Nov 2012 09:26:17 +0000 (10:26 +0100)]
hammer.8: Add back an .El that was removed by mistake.

17 months agorpc.statd(8): Remove a duplicate function.
Sascha Wildner [Sat, 10 Nov 2012 10:03:17 +0000 (11:03 +0100)]
rpc.statd(8): Remove a duplicate function.

By now, xdr_stat_chge() is in librpcsvc, unlike what the comments suggest.

17 months agoFix INVARIANT build issue
Adam Sakareassen [Thu, 8 Nov 2012 15:46:00 +0000 (02:46 +1100)]
Fix INVARIANT build issue

17 months agovquota(8): size information is expressed in bytes
François Tigeot [Fri, 9 Nov 2012 23:07:51 +0000 (00:07 +0100)]
vquota(8): size information is expressed in bytes

17 months agoMark some functions in userland __printflike.
Sascha Wildner [Fri, 9 Nov 2012 23:19:30 +0000 (00:19 +0100)]
Mark some functions in userland __printflike.

17 months agondis_events(8): Remove a bogus argument.
Sascha Wildner [Fri, 9 Nov 2012 23:19:05 +0000 (00:19 +0100)]
ndis_events(8): Remove a bogus argument.

17 months agobsd.init.mk: Establish compatibility with FreeBSD makefiles
John Marino [Thu, 8 Nov 2012 10:46:55 +0000 (11:46 +0100)]
bsd.init.mk: Establish compatibility with FreeBSD makefiles

FreeBSD changed NOMAN to NO_MAN and NOSHARED to NO_SHARED.  Rather than
follow suit, establish NO_MAN and NO_SHARED as aliases for the DragonFly
versions.  If both are defined, the DragonFly version takes precedence.

These were put in bsd.init.mk because they have to be loaded after the
makefile being processed but before bsd.prog.mk, bsd.lib.mk, etc.

17 months agodebug - Add a basic Makefile
Antonio Huete Jimenez [Thu, 8 Nov 2012 15:17:32 +0000 (16:17 +0100)]
debug - Add a basic Makefile

- Sync wildcardinfo with current state of affairs.

17 months agoobjcache.9: cluster_limit is no longer changed
Stathis Kamperis [Thu, 8 Nov 2012 16:18:29 +0000 (18:18 +0200)]
objcache.9: cluster_limit is no longer changed

17 months agokernel: Mark two more functions __printflike.
Sascha Wildner [Thu, 8 Nov 2012 08:50:27 +0000 (09:50 +0100)]
kernel: Mark two more functions __printflike.

17 months agompt(4): Mark two functions __printflike.
Sascha Wildner [Thu, 8 Nov 2012 08:28:04 +0000 (09:28 +0100)]
mpt(4): Mark two functions __printflike.

17 months agogetline(3): Fix segfault caused by NULL pointer
John Marino [Wed, 7 Nov 2012 20:15:35 +0000 (21:15 +0100)]
getline(3): Fix segfault caused by NULL pointer

This fixes a segfault seen with pkg's audit function, and effectively syncs
getdelim with FreeBSD.

Taken-from: FreeBSD SVN 197752 (04 OCT 2009)

- Tolerate applications that pass a NULL pointer for the buffer and
  claim that the capacity of the buffer is nonzero.

- If an application passes in a non-NULL buffer pointer and claims the
  buffer has zero capacity, we should free (well, realloc) it anyway.
  It could have been obtained from malloc(0), so failing to free it
  would be a small memory leak.

17 months agomfi(4): Don't assert lock holding when dumping or during a panic.
Sascha Wildner [Wed, 7 Nov 2012 21:10:51 +0000 (22:10 +0100)]
mfi(4): Don't assert lock holding when dumping or during a panic.

FreeBSD's mtx_assert() does it the same way, but we usually translate
mtx_assert() into a KKASSERT(lockstatus(&lock, curthread) != 0).

For now, replace all of these assertions in mfi(4) with a function that
mimics the mtx_assert() behavior of FreeBSD, since some of the asserting
functions are used by the dumping code.

We might think about a real lockassert() function in the future that
has this exception too.

This commit fixes dumping on most supported adapters. Thunderbolt series
adapters still have an (unrelated) command timeout issue which I'm
looking at.

Reported and tested (on a PERC 5/i) by Tim Howe <tim@130collective.org>.