dragonfly.git
3 years agoAdd -Wold-style-declaration to the kernel's warning flags.
Sascha Wildner [Sat, 10 Dec 2011 13:45:37 +0000 (14:45 +0100)]
Add -Wold-style-declaration to the kernel's warning flags.

While here, clean up the comments a bit. -Wextra cleanness is not
something we're aiming for. What we want are warnings that help
catching bugs and/or keeping the code nice, but at the same time
don't get on anyone's nerves.

3 years agoAdd vknetd to etc/rc.d/Makefile.
Sascha Wildner [Sat, 10 Dec 2011 10:35:36 +0000 (11:35 +0100)]
Add vknetd to etc/rc.d/Makefile.

3 years ago<sys/ktr.h>: Move static to the first place in declarations.
Sascha Wildner [Sat, 10 Dec 2011 00:56:11 +0000 (01:56 +0100)]
<sys/ktr.h>: Move static to the first place in declarations.

The C standard discourages placing storage-class specifiers (typedef,
extern, static, auto, register) other than first in a declaration since
C90.

3 years agokernel: Add acpi_if.h to the ACPI module Makefiles.
Sascha Wildner [Sat, 10 Dec 2011 00:53:08 +0000 (01:53 +0100)]
kernel: Add acpi_if.h to the ACPI module Makefiles.

3 years agobuildkernel: Disable building of acpi_hp.ko. It will not load.
Sascha Wildner [Fri, 9 Dec 2011 23:46:43 +0000 (00:46 +0100)]
buildkernel: Disable building of acpi_hp.ko. It will not load.

3 years agoFix various whitespace and indent issues (no functional change).
Sascha Wildner [Fri, 9 Dec 2011 19:12:15 +0000 (20:12 +0100)]
Fix various whitespace and indent issues (no functional change).

3 years agopfctl(8): Add missing braces.
Sascha Wildner [Fri, 9 Dec 2011 18:53:53 +0000 (19:53 +0100)]
pfctl(8): Add missing braces.

3 years agopw(8): Add missing braces.
Sascha Wildner [Fri, 9 Dec 2011 18:42:00 +0000 (19:42 +0100)]
pw(8): Add missing braces.

3 years agodfregress(8): Add some missing braces.
Sascha Wildner [Fri, 9 Dec 2011 18:05:33 +0000 (19:05 +0100)]
dfregress(8): Add some missing braces.

3 years agolib: Fix various whitespace and indent issues (no functional change).
Sascha Wildner [Fri, 9 Dec 2011 16:55:19 +0000 (17:55 +0100)]
lib: Fix various whitespace and indent issues (no functional change).

3 years agoSome cosmetics: #if(0) -> #if 0
Sascha Wildner [Fri, 9 Dec 2011 12:21:31 +0000 (13:21 +0100)]
Some cosmetics: #if(0) -> #if 0

3 years agokernel/nfs: Fix a bug due to missing braces.
Sascha Wildner [Fri, 9 Dec 2011 11:38:39 +0000 (12:38 +0100)]
kernel/nfs: Fix a bug due to missing braces.

The lwkt_reltoken() was added in c6b43e93a6cf0a70bde32cd141057a0df9860e13
but it was forgotten to put braces around the if's body (now having
lwkt_reltoken() and the return()).

3 years agokernel: Fix various whitespace and indent issues (no functional change).
Sascha Wildner [Fri, 9 Dec 2011 10:47:25 +0000 (11:47 +0100)]
kernel: Fix various whitespace and indent issues (no functional change).

3 years agosf(4): Remove a duplicated flag in a header.
Sascha Wildner [Thu, 8 Dec 2011 19:01:48 +0000 (20:01 +0100)]
sf(4): Remove a duplicated flag in a header.

3 years agorc.conf.5: Start a sentence in upper case.
Sascha Wildner [Thu, 8 Dec 2011 09:33:39 +0000 (10:33 +0100)]
rc.conf.5: Start a sentence in upper case.

3 years agotcpdump(1): Fix some sizeof(sizeof(x)) issues.
Sascha Wildner [Thu, 8 Dec 2011 08:26:24 +0000 (09:26 +0100)]
tcpdump(1): Fix some sizeof(sizeof(x)) issues.

Has been committed upstream too:

http://sourceforge.net/tracker/?func=detail&aid=3453360&group_id=53066&atid=469573

3 years agoacpi: Include acdragonfly.h from acenv.h.
Sascha Wildner [Thu, 8 Dec 2011 08:16:15 +0000 (09:16 +0100)]
acpi: Include acdragonfly.h from acenv.h.

3 years agokernel - Support bdwrite() on tmpfs buffer cache buffers
Matthew Dillon [Thu, 8 Dec 2011 06:32:33 +0000 (22:32 -0800)]
kernel - Support bdwrite() on tmpfs buffer cache buffers

* tmpfs itself does not call bdwrite() when no swap space has been
  allocated but certain system side effects such as nvtruncbuf()
  when a file is truncated CAN cause bdwrite() to be called.

  This eventually causes the buffer to run through tmpfs's strategy
  function.

* Adjust the strategy function to handle the no-swap case by marking
  the underlying pages dirty and valid and completing the I/O.

* Also handle the case when swap exists but fills up.  If the
  swap_strategy() function fails with ENOMEM fall-back to again
  marking the pages dirty andvalid and completing the I/O.

  This allows tmpfs to fill up to the system's total memory+swap instead
  of just the system's swap.

3 years agotcp: Don't check PRUS_OOB again in tcp_usr_send
Sepherosa Ziehau [Thu, 8 Dec 2011 05:38:37 +0000 (13:38 +0800)]
tcp: Don't check PRUS_OOB again in tcp_usr_send

- It is not necessary; it was checked in sosendtcp
- It does not work w/ asynchronized pru_send

Reminded-by: dillon@
3 years agokernel - Fix missing token release on I/O error during exec
Matthew Dillon [Thu, 8 Dec 2011 05:36:57 +0000 (21:36 -0800)]
kernel - Fix missing token release on I/O error during exec

* If an EIO occurs while exec is mapping pages from the binary we need
  to drop the vm_object we are holding before returning.

* Fixes panic when the system runs out of memory and no swap is present.

3 years agokernel - Remove partially commit debug code
Matthew Dillon [Thu, 8 Dec 2011 04:22:45 +0000 (20:22 -0800)]
kernel - Remove partially commit debug code

* Remove partially committed debug code that will cause the compile
  to fail.

3 years agokernel - Remove unneeded initialization
Matthew Dillon [Thu, 8 Dec 2011 04:19:40 +0000 (20:19 -0800)]
kernel - Remove unneeded initialization

* vm_object->flags is set to 0 by _vm_object_allocate() and does not
  need to be set to 0 again.

3 years agokernel - Clear the quick-return flag when changing PSL_IOPL.
Matthew Dillon [Thu, 8 Dec 2011 04:18:07 +0000 (20:18 -0800)]
kernel - Clear the quick-return flag when changing PSL_IOPL.

* Make sure we do a full syscall return when changing PSL_IOPL.

3 years agokernel - Add additional safety assertions in the pmap path
Matthew Dillon [Thu, 8 Dec 2011 04:16:36 +0000 (20:16 -0800)]
kernel - Add additional safety assertions in the pmap path

* Assert additional state is correct in pmap_pinit()

* Assert that the critical section count makes preemption impossible
  in pmap_interlock_wait(), which is called from the depths of swtch.s
  during a thread switch.

3 years agokernel - Adjust stack by an addition 128 in sendupcall()
Matthew Dillon [Thu, 8 Dec 2011 04:14:56 +0000 (20:14 -0800)]
kernel - Adjust stack by an addition 128 in sendupcall()

* Adjust stack by an addition 128 in sendupcall() for red-zone
  Note however that this code is currently unused, so it has no effect.

* If getmemsize() finds an overlapping region we break out of the inner
  loop so we can continue the outer loop.

Reported-by: swildner
3 years agokernel - Add -fno-stack-protector for kernel build
Matthew Dillon [Thu, 8 Dec 2011 04:14:04 +0000 (20:14 -0800)]
kernel - Add -fno-stack-protector for kernel build

* Add -fno-stack-protector for kernel build in order to be consistent
  with the other platform kernel builds

* Has no effect with the current version of gcc but may prevent bad vibes
  in the future.

3 years agokernel - Do not use LK_NOWAIT for vfs_busy() after initialization
Matthew Dillon [Thu, 8 Dec 2011 04:13:09 +0000 (20:13 -0800)]
kernel - Do not use LK_NOWAIT for vfs_busy() after initialization

* Minor adjustment, this is more appropriate then what we had but it
  will not effect the code since nobody references the mp yet at this
  point (thus the lock always succeeds even w/ LK_NOWAIT).

3 years agokernel - Fix panic during diskless mount
Matthew Dillon [Thu, 8 Dec 2011 04:10:13 +0000 (20:10 -0800)]
kernel - Fix panic during diskless mount

* Remove improper vfs_unbusy()'s from the nfs_mountroot path.  The mount
  is unbusied by the caller instead.  This fixes a lockmgr panic.

3 years agokernel - Fix endless nfs error 70 during shutdown
Matthew Dillon [Thu, 8 Dec 2011 04:08:03 +0000 (20:08 -0800)]
kernel - Fix endless nfs error 70 during shutdown

* When shutting down NFS rw mounts left over buffers may not be able to
  flush during a forced unmount.

* When unable to flush during a forced unmount mark the bp EIO instead
  of ESTALE and also mark it B_INVAL to remove the buffer from the the
  vnode.

3 years agokernel - Add TDF_RUNNING assertions
Matthew Dillon [Thu, 8 Dec 2011 02:51:52 +0000 (18:51 -0800)]
kernel - Add TDF_RUNNING assertions

* Assert that the target lwkt thread being switched to is not flagged as
  running.

* Assert that the originating lwkt thread being switched from is flagged as
  running.

* Fix the running flag initial condition for the idle thread.

3 years agokernel - Fix alarm() timer race against exit
Matthew Dillon [Thu, 8 Dec 2011 02:44:15 +0000 (18:44 -0800)]
kernel - Fix alarm() timer race against exit

* Stop the callout synchronously to ensure that any pending alarm timeout
  is completely removed before we allow a process to exit.

* Add a required PHOLD() to the relaitexpire() function.

3 years agokernel - add DEBUG_LOCKS_LATENCY option
Matthew Dillon [Thu, 8 Dec 2011 02:42:01 +0000 (18:42 -0800)]
kernel - add DEBUG_LOCKS_LATENCY option

* This is for debugging only, default disabled.  If optioned this adds
  a sysctl to add a forced latency loop (count to N) in front of any
  spinlock or gettoken.

3 years agobuildworld - Add uuid for HAMMER2
Matthew Dillon [Thu, 8 Dec 2011 02:40:06 +0000 (18:40 -0800)]
buildworld - Add uuid for HAMMER2

* Add the uuid for a HAMMER2 filesystem

3 years agobuildworld - Fix -j n collisions
Matthew Dillon [Thu, 8 Dec 2011 02:38:07 +0000 (18:38 -0800)]
buildworld - Fix -j n collisions

* Each of _gcc41_tools and _gcc44_tools needs to be ordered

* Currently installation of the objc include files can collide in a way
  that interferes with a parallel build, when gcc41 and gcc44 are built
  concurrently.  For now don't build them concurrently :-(.

3 years agokernel - Fix panic in vm_page_try_to_free()
Matthew Dillon [Thu, 8 Dec 2011 02:36:10 +0000 (18:36 -0800)]
kernel - Fix panic in vm_page_try_to_free()

* This function is supposed to work with the VM page in any state, including
  a potentially free state.

* Add additional checks to ignore the page if it is already in PQ_FREE or
  PQ_HOLD

Reported-by: sephe
3 years agokernel - Fix kqueue race with NOTE_EXIT
Matthew Dillon [Thu, 8 Dec 2011 02:34:01 +0000 (18:34 -0800)]
kernel - Fix kqueue race with NOTE_EXIT

* Fix a kqueue race where the process receiving a NOTE_EXIT can go
  away while the NOTE_EXIT is being delivered.

* Add a required PHOLD/PRELE since knote_remove() can block.

* Properly return on-zero if KN_DETACHED is set at the end of knote_release()
  so the caller knows to restart the list scan.

Reported-by: sephe
3 years agokernel/netgraph: Set resp to NULL if it is kfree()'d in the switch case.
Sascha Wildner [Wed, 7 Dec 2011 21:11:09 +0000 (22:11 +0100)]
kernel/netgraph: Set resp to NULL if it is kfree()'d in the switch case.

This will prevent a later kfree() in the function from freeing it again.

3 years agokfree.cocci: Add a few more memory freeing functions to take into account.
Sascha Wildner [Wed, 7 Dec 2011 18:03:13 +0000 (19:03 +0100)]
kfree.cocci: Add a few more memory freeing functions to take into account.

3 years agox86_64/ioapic: Always allow user to specify GSI's target CPU
Sepherosa Ziehau [Wed, 7 Dec 2011 13:07:19 +0000 (21:07 +0800)]
x86_64/ioapic: Always allow user to specify GSI's target CPU

Even if interrupt automatic load balance is disable we still should
obey the explicit GSI target CPU configuration.

3 years agox86_64/icu: Implement rman_setup MachIntrABI method
Sepherosa Ziehau [Wed, 7 Dec 2011 12:05:16 +0000 (20:05 +0800)]
x86_64/icu: Implement rman_setup MachIntrABI method

- Add per-cpu IRQ mapping support
- Use MachIntrABI.rman_setup to set the interrupt rman's managing
  regions properly

3 years agokernel: Save another bzero() by using M_ZERO.
Sascha Wildner [Tue, 6 Dec 2011 19:01:43 +0000 (20:01 +0100)]
kernel: Save another bzero() by using M_ZERO.

3 years agokernel: Remove another NULL check after kmalloc() with M_WAITOK.
Sascha Wildner [Tue, 6 Dec 2011 19:01:11 +0000 (20:01 +0100)]
kernel: Remove another NULL check after kmalloc() with M_WAITOK.

3 years agovknetd - Document recently added rc.d script.
Antonio Huete Jimenez [Tue, 6 Dec 2011 18:47:53 +0000 (19:47 +0100)]
vknetd - Document recently added rc.d script.

3 years ago<sys/malloc.h>: Remove the MALLOC() and FREE() macros.
Sascha Wildner [Tue, 6 Dec 2011 17:09:15 +0000 (18:09 +0100)]
<sys/malloc.h>: Remove the MALLOC() and FREE() macros.

3 years agokernel: Replace all usage of MALLOC()/FREE() with kmalloc()/kfree().
Sascha Wildner [Tue, 6 Dec 2011 17:58:34 +0000 (18:58 +0100)]
kernel: Replace all usage of MALLOC()/FREE() with kmalloc()/kfree().

3 years agorc.d - Add a basic vknetd script.
Antonio Huete Jimenez [Tue, 6 Dec 2011 17:59:30 +0000 (18:59 +0100)]
rc.d - Add a basic vknetd script.

3 years agokernel - Remove unnecessary < 0 checks for sopt_valsize unsigned field + fixup
Matthew Dillon [Tue, 6 Dec 2011 17:21:35 +0000 (09:21 -0800)]
kernel - Remove unnecessary < 0 checks for sopt_valsize unsigned field + fixup

* Remove unnecessary < 0 checks for sopt_valsize, which is an unsigned field

* Add an upper-bound test in one place which did not have it.

Reported-by: Edward O'callaghan, logan1
3 years agovknetd.8: Use the full month name in .Dd.
Sascha Wildner [Tue, 6 Dec 2011 13:41:20 +0000 (14:41 +0100)]
vknetd.8: Use the full month name in .Dd.

3 years agokfree.cocci: We neither have BUG() nor BUG_ON().
Sascha Wildner [Tue, 6 Dec 2011 13:41:12 +0000 (14:41 +0100)]
kfree.cocci: We neither have BUG() nor BUG_ON().

3 years agoAdd a coccinelle patch that searches for use-after-kfree.
Sascha Wildner [Tue, 6 Dec 2011 11:14:13 +0000 (12:14 +0100)]
Add a coccinelle patch that searches for use-after-kfree.

Taken-from: Linux

3 years agomlx(4): Don't free 'meo' until we're finished using it.
Sascha Wildner [Tue, 6 Dec 2011 10:35:01 +0000 (11:35 +0100)]
mlx(4): Don't free 'meo' until we're finished using it.

3 years agokernel/nfs: Don't free 'info' until we're finished using it.
Sascha Wildner [Tue, 6 Dec 2011 10:34:35 +0000 (11:34 +0100)]
kernel/nfs: Don't free 'info' until we're finished using it.

3 years agocryptodev(4): Fix a bug where the wrong key was bzero()'d before kfree().
Sascha Wildner [Tue, 6 Dec 2011 09:33:29 +0000 (10:33 +0100)]
cryptodev(4): Fix a bug where the wrong key was bzero()'d before kfree().

3 years agodpt(4): Remove duplicate bit in an | operation.
Sascha Wildner [Tue, 6 Dec 2011 07:46:32 +0000 (08:46 +0100)]
dpt(4): Remove duplicate bit in an | operation.

3 years agopthread_condattr_setclock(3): Fix the check for a known clock.
Sascha Wildner [Mon, 5 Dec 2011 21:46:06 +0000 (22:46 +0100)]
pthread_condattr_setclock(3): Fix the check for a known clock.

The way it was before, this function would always return EINVAL.

3 years agovknetd - Fix a bug in previous commit.
Antonio Huete Jimenez [Mon, 5 Dec 2011 15:45:45 +0000 (16:45 +0100)]
vknetd - Fix a bug in previous commit.

We have to create pidfile and install signal handlers for the child.

3 years agokernel: Use M_ZERO for kmalloc() instead of bzero()ing.
Sascha Wildner [Mon, 5 Dec 2011 13:53:56 +0000 (14:53 +0100)]
kernel: Use M_ZERO for kmalloc() instead of bzero()ing.

3 years agokernel: Remove some unneeded NULL checks after kmalloc() with M_WAITOK.
Sascha Wildner [Mon, 5 Dec 2011 10:39:06 +0000 (11:39 +0100)]
kernel: Remove some unneeded NULL checks after kmalloc() with M_WAITOK.

3 years agovknetd - Add pidfile and signal handlers.
Antonio Huete Jimenez [Sun, 4 Dec 2011 23:47:17 +0000 (00:47 +0100)]
vknetd - Add pidfile and signal handlers.

When started up, vknetd will create a pidfile in
/var/run/vknetd.pid by default or where specified
by option -i.

Add signal handlers to cleanup pid file.

3 years agokernel/netinet6: Add back a ':' I accidentally removed.
Sascha Wildner [Sun, 4 Dec 2011 22:09:31 +0000 (23:09 +0100)]
kernel/netinet6: Add back a ':' I accidentally removed.

3 years agokernel/netinet6: Fix stupid NULL pointer derefs.
Sascha Wildner [Sun, 4 Dec 2011 22:00:42 +0000 (23:00 +0100)]
kernel/netinet6: Fix stupid NULL pointer derefs.

3 years agokernel: Move some dereferences below the NULL checks.
Sascha Wildner [Sun, 4 Dec 2011 19:15:43 +0000 (20:15 +0100)]
kernel: Move some dereferences below the NULL checks.

3 years agokernel: Fix two cases of sizeof(sizeof(x)).
Sascha Wildner [Sun, 4 Dec 2011 17:08:16 +0000 (18:08 +0100)]
kernel: Fix two cases of sizeof(sizeof(x)).

3 years agoAdd a simple coccinelle patch for finding NELEM() candidates.
Sascha Wildner [Sun, 4 Dec 2011 16:06:44 +0000 (17:06 +0100)]
Add a simple coccinelle patch for finding NELEM() candidates.

From a similar NetBSD patch from the web.

3 years agokernel: Use NELEM() in some more places.
Sascha Wildner [Sun, 4 Dec 2011 13:32:47 +0000 (14:32 +0100)]
kernel: Use NELEM() in some more places.

3 years agopru_send: Allow non-NULL address parameter to be passed
Sepherosa Ziehau [Sun, 4 Dec 2011 13:21:51 +0000 (21:21 +0800)]
pru_send: Allow non-NULL address parameter to be passed

Currently the passed in address is copied into a newly allocated
memory (grr, additional blocking kmalloc), and the PRUS_FREEADDR
will be set so that protocol thread could know when to free the
address.

Before this change netperf UDP_STREAM (unconnected socket) could
only do ~200Kpps (w/ -m 18), now it could do ~990Kpps (w/ -m 18).
This gives ~500% performance improvement for tiny UDP packet TX.
The improvement is not as good as the connected socket, which is
~600%, mainly because of the additional memory allocation for
the address.  We _may_ further optimize out the address allocation.

3 years agoudp: Support asynchronized pru_send for connected socket
Sepherosa Ziehau [Sun, 4 Dec 2011 10:43:40 +0000 (18:43 +0800)]
udp: Support asynchronized pru_send for connected socket

The result:

192.168.3.1 PhenomII 970 (runs netperf, hw 82571EB)
192.168.3.2 Phenom 9550 (runs netserver, hw 82574L)

netperf -H 192.168.3.2 -t UDP_STREAM -P0 -l 30 -- -n -m 18
(10 second `netstat -nI emx0 -w 1`, unit: pps)

  old      new
204736   1225536
203712   1224960
203520   1224640
202880   1228416
203392   1225408
203648   1224960
203456   1219968
203648   1224064
203712   1218880
204224   1222464

This gives ~600% tiny UDP packet TX performance improvement.

The the current tiny UDP packet TX rate (1.22Mpps) is quite near
the 1.48Mpps 1000baseT limitation.

3 years agoudp: Prepare for the asynchronized pru_send 2
Sepherosa Ziehau [Sat, 3 Dec 2011 14:07:10 +0000 (22:07 +0800)]
udp: Prepare for the asynchronized pru_send 2

Save the MSG_DONTROUTE in the netmsg instead of messing w/ socket.so_options

3 years agoudp: Prepare for the asynchronized pru_send
Sepherosa Ziehau [Sat, 3 Dec 2011 13:41:17 +0000 (21:41 +0800)]
udp: Prepare for the asynchronized pru_send

Save necessary netmsg information into stack variables

3 years agoudp: Simplify udp_output interface
Sepherosa Ziehau [Sat, 3 Dec 2011 13:26:47 +0000 (21:26 +0800)]
udp: Simplify udp_output interface

3 years agodhclient - Use -q option instead of redirection.
Antonio Huete Jimenez [Sat, 3 Dec 2011 21:08:40 +0000 (22:08 +0100)]
dhclient - Use -q option instead of redirection.

Obtained-from: OpenBSD

3 years agodhclient - Do not add/remove route 127.0.0.1 for our newly assigned IP/aliases.
Antonio Huete Jimenez [Sat, 3 Dec 2011 18:18:21 +0000 (19:18 +0100)]
dhclient - Do not add/remove route 127.0.0.1 for our newly assigned IP/aliases.

Taken-from: FreeBSD 149479

3 years agoVFS accounting: implement an initialization framework
Francois Tigeot [Sat, 6 Aug 2011 21:02:32 +0000 (23:02 +0200)]
VFS accounting: implement an initialization framework

Only enable accounting for a short list of whitelisted filesystem types

3 years agonrelease: In the mk.conf we add, don't quote PKG_DEFAULT_OPTIONS.
Sascha Wildner [Sat, 3 Dec 2011 11:52:40 +0000 (12:52 +0100)]
nrelease: In the mk.conf we add, don't quote PKG_DEFAULT_OPTIONS.

It will not work with quotes.

Reported-by: Matthias Rampke <matthias@rampke.de>
3 years agodu(1): Move the fts_close() behind fts_read()'s errno check.
Sascha Wildner [Sat, 3 Dec 2011 09:39:06 +0000 (10:39 +0100)]
du(1): Move the fts_close() behind fts_read()'s errno check.

3 years agoAdd missing fts_close() calls
François Tigeot [Sat, 3 Dec 2011 08:40:15 +0000 (09:40 +0100)]
Add missing fts_close() calls

3 years agovquota.8: Add a missing .El and use . instead of empty lines.
Sascha Wildner [Sat, 3 Dec 2011 08:37:46 +0000 (09:37 +0100)]
vquota.8: Add a missing .El and use . instead of empty lines.

3 years agovquota(8): style(9)/whitespace fixes.
Sascha Wildner [Sat, 3 Dec 2011 07:44:40 +0000 (08:44 +0100)]
vquota(8): style(9)/whitespace fixes.

3 years agoUnbreak buildworld on i386
François Tigeot [Fri, 2 Dec 2011 23:51:16 +0000 (00:51 +0100)]
Unbreak buildworld on i386

3 years agopf: fix another double lock release
Jan Lentfer [Fri, 2 Dec 2011 22:39:16 +0000 (23:39 +0100)]
pf: fix another double lock release

    On module unload pf_consistency_lock was
    already released by pf_purge_expired_states().

3 years agoAdd a skeleton vquota(8) manpage
Francois Tigeot [Sun, 4 Sep 2011 12:33:09 +0000 (14:33 +0200)]
Add a skeleton vquota(8) manpage

3 years agoAdd a vquota(8) utility
Francois Tigeot [Sat, 6 Aug 2011 20:57:36 +0000 (22:57 +0200)]
Add a vquota(8) utility

3 years agopf -- Remove unused pf_mod_lck.
Venkatesh Srinivas [Fri, 2 Dec 2011 18:02:27 +0000 (10:02 -0800)]
pf -- Remove unused pf_mod_lck.

pf_mod_lck was not used, except in a lksleep on module unload.

Reported-by: tuxillo
3 years agoaccept: Call pru_accept in protocol thread
Sepherosa Ziehau [Fri, 2 Dec 2011 11:54:17 +0000 (19:54 +0800)]
accept: Call pru_accept in protocol thread

This avoids socket.so_pcb use-after-check race against protocol thread.

There is no performance impact on the mostly used sockets:
- IPv4/IPv6 TCP implemented pru_savefaddr, so their pru_accept will not
  be called at all
- UNIX domain socket uses sync msgport, so no protocol thread dispatching

3 years agoFix some whitespace issues.
Sascha Wildner [Fri, 2 Dec 2011 10:11:48 +0000 (11:11 +0100)]
Fix some whitespace issues.

3 years agokernel - Use atomic allocate-hold in vnode_pager_alloc().
Matthew Dillon [Fri, 2 Dec 2011 04:17:10 +0000 (20:17 -0800)]
kernel - Use atomic allocate-hold in vnode_pager_alloc().

* Use vm_object_allocate_hold() in vnode_pager_alloc() to atomically
  initialize the additional fields with the object lock held throughout.

Reported-by: Venkatesh Srinivas <vsrinivas@crater.dragonflybsd.org>
3 years agoHAMMER VFS - Attempt to fix a low-memory deadlock
Matthew Dillon [Fri, 2 Dec 2011 01:13:40 +0000 (17:13 -0800)]
HAMMER VFS - Attempt to fix a low-memory deadlock

* (add missing header file change for last commit)

3 years agoHAMMER VFS - Attempt to fix a low-memory deadlock
Matthew Dillon [Fri, 2 Dec 2011 01:12:12 +0000 (17:12 -0800)]
HAMMER VFS - Attempt to fix a low-memory deadlock

* Avoid trying to allocate a new buffer cache buffer when memory is
  low from inside the blockmap allocation path (where the global
  blockmap lock is held).

Reported-by: tuxillo
3 years agokernel - Refactor the vmspace locking code and several use cases
Matthew Dillon [Fri, 2 Dec 2011 00:54:19 +0000 (16:54 -0800)]
kernel - Refactor the vmspace locking code and several use cases

* Reorder the vnode ref/rele sequence in the exec path so p_textvp is
  left in a more valid state while being initialized.

* Removing the vm_exitingcnt test in exec_new_vmspace().  Release
  various resources unconditionally on the last exiting thread regardless
  of the state of exitingcnt.  This just moves some of the resource
  releases out of the wait*() system call path and back into the exit*()
  path.

* Implement a hold/drop mechanic for vmspaces and use them in procfs_rwmem(),
  vmspace_anonymous_count(), and vmspace_swap_count(), and various other
  places.

  This does a better job protecting the vmspace from deletion while various
  unrelated third parties might be trying to access it.

* Implement vmspace_free() for other code to call instead of them trying
  to call sysref_put() directly.  Interlock with a vmspace_hold() so
  final termination processing always keys off the vm_holdcount.

* Implement vm_object_allocate_hold() and use it in a few places in order
  to allow OBJT_SWAP objects to be allocated atomically, so other third
  parties (like the swapcache cleaning code) can't wiggle their way in
  and access a partially initialized object.

* Reorder the vmspace_terminate() code and introduce some flags to ensure
  that resources are terminated at the proper time and in the proper order.

3 years agokernel - Remove unnecessary MP lock in vgone_vxlocked()
Matthew Dillon [Fri, 2 Dec 2011 00:51:32 +0000 (16:51 -0800)]
kernel - Remove unnecessary MP lock in vgone_vxlocked()

* Remove an unnecessary MP lock from the vnode destruction path.

3 years agolibkvm - Fix seg-fault in ps output when loading a process's argv
Matthew Dillon [Thu, 1 Dec 2011 23:53:24 +0000 (15:53 -0800)]
libkvm - Fix seg-fault in ps output when loading a process's argv

* An offset calculation used when the string space is relocated by realloc
  was being stored in an 'int' instead of a 'size_t', causing the
  recalculated pointer to go wild.

3 years agokernel - Enhanced lockmgr debugging, panic in double unlock
Matthew Dillon [Thu, 1 Dec 2011 23:24:01 +0000 (15:24 -0800)]
kernel - Enhanced lockmgr debugging, panic in double unlock

* Panic if an attempt is made to unlock a lock which is not locked.

* Add some additinal debugging (disabled)

3 years agokernel - Fix lost lock in devfs
Matthew Dillon [Thu, 1 Dec 2011 23:22:44 +0000 (15:22 -0800)]
kernel - Fix lost lock in devfs

* vn_lock() will always fail if a vnode is undergoing reclamation, do
  not try to unlock/relock in the spec_close code in that case.

* Refactor the error test in devfs_allocv() in case vget() returns
  an error other than ENOENT in the future.

3 years agokernel - Remove double unlock in elf core dumping code
Matthew Dillon [Thu, 1 Dec 2011 23:19:09 +0000 (15:19 -0800)]
kernel - Remove double unlock in elf core dumping code

* Remove a double vnode unlock in the elf core dumping code.  vn_unlock()
  ignored double unlocks before but soon won't.

3 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 1 Dec 2011 23:18:53 +0000 (15:18 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

3 years agoFix a bug in nullfs_mount() and nullfs_statfs()
François Tigeot [Sun, 14 Aug 2011 13:13:30 +0000 (15:13 +0200)]
Fix a bug in nullfs_mount() and nullfs_statfs()

Most filesystems register the name of their mount point at mount time and
are able to return it later with a VFS_STATFS call. nullfs did not.

3 years agoAdjust some comment indentation.
Sascha Wildner [Thu, 1 Dec 2011 19:36:28 +0000 (20:36 +0100)]
Adjust some comment indentation.

3 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 1 Dec 2011 19:14:24 +0000 (11:14 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

3 years agoMerge branch 'master' of /repository/git/dragonfly
Venkatesh Srinivas [Thu, 1 Dec 2011 19:12:30 +0000 (11:12 -0800)]
Merge branch 'master' of /repository/git/dragonfly

3 years agokernel - ddb: Print raw instruction pointers in ddb backtrace.
Venkatesh Srinivas [Thu, 1 Dec 2011 19:11:58 +0000 (11:11 -0800)]
kernel - ddb: Print raw instruction pointers in ddb backtrace.