rwatson [Sun, 24 Oct 2004 23:45:01 +0000 (23:45 +0000)]
Move from using the socket reference count to the file reference
count to prevent sockets from being garbage collected during
socket-specific system calls. This is the same approach used in
most VFS-specific system calls, as well as generic file descriptor
system calls such as read() and write().
To do this, add a utility function getsock(), which is logically
identical to getvnode() used for the same purpose in VFS. Unlike
fgetsock(), it returns with the file reference count elevated, but
no bump of the socket reference count. Replace matching calls to
fputsock() with fdrop().
This change is made to all socket system calls other than
sendfile() and accept(), but the approach should be applicable to
those system calls also.
This shaves about four mutex operations off of each of these
system calls, including send() and recv() variants, adding about
1% to pps on minimal UDP packets for UP using netblast, and 4% on
SMP.
yar [Sun, 24 Oct 2004 20:12:08 +0000 (20:12 +0000)]
Log the actual number of bytes sent on the wire to /var/log/ftpd
instead of the disk size of the file sent. Since the log file
is intended to provide data for anonymous ftp traffic accounting,
the disk size of the file isn't really informative in this case.
mlaier [Sun, 24 Oct 2004 19:35:02 +0000 (19:35 +0000)]
Fix a panic discovered with some apache2 configure test (that seemed to
trigger a socket creation race some some kind). Checking for non-NULL socket
and credential is not a bad idea anyway. Unfortunatly too late for the
release.
Reported & tested by: Gilbert Cao
MFC after: 2 weeks
alc [Sun, 24 Oct 2004 19:32:19 +0000 (19:32 +0000)]
Acquire the vm object lock before rather than after calling
vm_page_sleep_if_busy(). (The motivation being to transition
synchronization of the vm_page's PG_BUSY flag from the global page queues
lock to the per-object lock.)
des [Sun, 24 Oct 2004 13:04:09 +0000 (13:04 +0000)]
- use `realpath /dev/dumpdev` instead of just /dev/dumpdev so messages
will show the real device name
- show different error messages for missing dump device and directory
des [Sun, 24 Oct 2004 09:38:41 +0000 (09:38 +0000)]
If the file specified in an "include" line does not exist in the current
directory, and its name does not begin with a period or a forward slash,
go look for it in ../../conf.
alc [Sun, 24 Oct 2004 07:12:13 +0000 (07:12 +0000)]
Avoid repeated acquisition and release of the vm object lock inside of
two loops in agp_generic_bind_memory(). As an intended side-effect, all
of the calls to vm_page_wakeup() are now performed with the containing
vm object lock held.
alc [Sun, 24 Oct 2004 06:15:36 +0000 (06:15 +0000)]
Introduce VM_ALLOC_NOBUSY, an option to vm_page_alloc() and vm_page_grab()
that indicates that the caller does not want a page with its busy flag set.
In many places, the global page queues lock is acquired and released just
to clear the busy flag on a just allocated page. Both the allocation of
the page and the clearing of the busy flag occur while the containing vm
object is locked. So, the busy flag might as well never be set.
scottl [Sun, 24 Oct 2004 05:37:23 +0000 (05:37 +0000)]
Import the HighPoint RocketRAID 182x driver. Thanks to HighPoint for
providing the original driver, and thanks to IronSystems for providing
hardware for testing.
davidxu [Sat, 23 Oct 2004 23:28:36 +0000 (23:28 +0000)]
1. Move thread list flags into new separate member, and atomically
put DEAD thread on GC list, this closes a race between pthread_join
and thr_cleanup.
2. Introduce a mutex to protect tcb initialization, tls allocation and
deallocation code in rtld seems no lock protection or it is broken,
under stress testing, memory is corrupted.
ru [Sat, 23 Oct 2004 21:34:41 +0000 (21:34 +0000)]
Expand the scope of the .SHELL specification to also cover
the compat mode of operation and the != operator.
While here, fixed a bug in the .SHELL directive processing
when only the name= attribute is specified and no built-in
shell matches this name, causing null pointer dereference.
phk [Sat, 23 Oct 2004 20:49:17 +0000 (20:49 +0000)]
Add a new per-thread private flag: TDP_GEOM.
This flag gets set whenever the thread posts an event on the GEOM
event queue, and if the flag is set when the thread is prepared
to return to userland from the kernel, g_waitidle() will be called
to make sure that the posted events have completed.
This can replace an insufficient number of g_waitidle() calls in
various other places, and has the advantage of being failsafe: Any
system call which does a VOP_OPEN()/VOP_CLOSE will now correctly
wait for any geom events it posted as part of spoils or tastes.
Assert that topology and Giant is not held in g_waitidle().
andre [Sat, 23 Oct 2004 19:06:43 +0000 (19:06 +0000)]
socreate() does an early abort if either the protocol cannot be found,
or pru_attach is NULL. With loadable protocols the SPACER dummy protocols
have valid function pointers for all methods to functions returning just
EOPNOTSUPP. Thus the early abort check would not detect immediately that
attach is not supported for this protocol. Instead it would correctly
get the EOPNOTSUPP error later on when it calls the protocol specific
attach function.
Add testing against the pru_attach_notsupp() function pointer to the
early abort check as well.
andre [Sat, 23 Oct 2004 18:45:53 +0000 (18:45 +0000)]
o Remove entire section talking about RTF_PRCLONING that got nuked in 5.2
already.
o Better description of IP fastforwarding. It can do the full thing now
including firewalling.
o Reword the description of ICMP redirects.
o Add references to route(4) and pfil(9).
rwatson [Sat, 23 Oct 2004 10:34:27 +0000 (10:34 +0000)]
Add some basic KTR tracing to busdma on i386. This is likely not
the final set of traces -- someone with more busdma background
will probably want to review and expand this, as well as port to
other platforms. This tracing is sufficient to identify key
busdma events on i386, and in particular to draw attention to
bounce buffering events that may have a substantial performance
impact.
mtm [Sat, 23 Oct 2004 08:33:10 +0000 (08:33 +0000)]
Locking cleanups to remove the need for a recursive mutex
o Instead of locking and unlocking all over the place, use
lock assertions to make certain that the bfe lock is held
where necessary.
o Create locked and unlocked versions of bfe_init and bfe_start. These
functions can be called from outside the module and by functions
within the bfe module. The calls from outside the module don't
hold the bfe lock so the unlocked versions called by these functions
simple obtain the bfe lock and call the locked version.
- Fix a typo (scp) in the locking macros that only worked because in all the
instances in which it was called the softc pointer happened to be named 'sc'.
arr [Fri, 22 Oct 2004 22:16:24 +0000 (22:16 +0000)]
- Turn KASSERT()s into warning printf()'s in the g_class_load() routine.
This removes a panic that will occur if you build with GENERIC and
attempt to kldload a GEOM module that is already in the kernel.