jeff [Sun, 13 Mar 2005 12:03:14 +0000 (12:03 +0000)]
- The VI_DOOMED flag now signals the end of a vnode's relationship with
the filesystem. Check that rather than VI_XLOCK.
- Shorten ffs_reload by one step. The old check for an inactive vnode
was slightly racey, and the code which deals with still active vnodes
is not much more expensive.
jeff [Sun, 13 Mar 2005 11:59:14 +0000 (11:59 +0000)]
- In ufs_mknod(), hold the lock across the call to vgone() as that is now
required.
- In ufs_close(), don't do the EAGAIN vrele hack, the top layer now calls
vn_start_write before the lock is acquired as it should.
jeff [Sun, 13 Mar 2005 11:57:39 +0000 (11:57 +0000)]
- Don't drop the lock in ufs_inactive().
- Also in ufs_inactive, don't acquire the vnode interlock where it isn't
strictly needed. Also owning the vnode interlock while calling vprint()
will cause locking assertions to trip.
jeff [Sun, 13 Mar 2005 11:56:28 +0000 (11:56 +0000)]
- Do a vn_start_write in vn_close, we may write if this is the last ref
on an unlinked file. We can't know if this is the case until after we
have the lock.
- Lock the vnode in vn_close, many filesystems had code which was unsafe
without the lock held, and holding it greatly simplifies vgone().
- Adjust vn_lock() to check for the VI_DOOMED flag where appropriate.
jeff [Sun, 13 Mar 2005 11:54:28 +0000 (11:54 +0000)]
- Remove vx_lock, vx_unlock, vx_wait, etc.
- Add a vn_start_write/vn_finished_write around vlrureclaim so we don't do
writing ops without suspending. This could suspend the vlruproc which
should not be a problem under normal circumstances.
- Manually implement VMIGHTFREE in vlrureclaim as this was the only instance
where it was used.
- Acquire a lock before calling vgone() as it now requires it.
- Move the acquisition of the vnode interlock from vtryrecycle() to
getnewvnode() so that if it fails we don't drop and reacquire the
vnode_free_list_mtx.
- Check for a usecount or holdcount at the end of vtryrecycle() in case
someone grabbed a ref while we were recycling. Abort the recycle, and
on the final ref drop this vnode will be placed on the head of the free
list.
- Move the redundant VOP_INACTIVE protection code into the local
vinactive() routine to avoid code bloat.
- Keep the vnode lock held across calls to vgone() in several places.
- vgonel() no longer uses XLOCK, instead callers must hold an exclusive
vnode lock. The VI_DOOMED flag is set to allow other threads to detect
a vnode which is no longer valid. This flag is set until the last
reference is gone, and there are no chances for a new ref. vgonel()
holds this lock across the entire function, which greatly simplifies
logic.
_ Only vfree() in one place in vgone() not three.
- Adjust vget() to check the VI_DOOMED flag prior to waiting on the lock
in the LK_NOWAIT case. In other cases, check after we have slept and
acquired an exlusive lock. This will simulate the old vx_wait()
behavior.
jeff [Sun, 13 Mar 2005 11:44:02 +0000 (11:44 +0000)]
- Get rid of VXLOCK, VXWANT, and vx_*. The vnode lock now protects us
against recycling.
- Modify VSHOULDFREE, VCANRECYCLE, etc. now that certain flags are no
longer important. Remove VMIGHTFREE as it is only used in one place.
iedowse [Sun, 13 Mar 2005 04:07:40 +0000 (04:07 +0000)]
Fix the arrangement of periodic QH tree to give the correct interval
between passes over a QH. Previously the accesses to a QH were
bunched together in time, so the interval was often much longer
than intended. This now appears to match the diagrams in the EHCI
spec, so remove the XXX comment.
kientzle [Sun, 13 Mar 2005 02:53:42 +0000 (02:53 +0000)]
Support extracting entries with pathnames longer than PATH_MAX. In
testing, I've archived and restored dir trees with ~1MB pathnames.
Most formats, of course, have much smaller limits.
kan [Sat, 12 Mar 2005 21:26:53 +0000 (21:26 +0000)]
Allow kernels loaded by pxeboot, which was compiled with LOADER_TFTP_SUPPORT,
to stll be able to mount NFS root as prescribed by DCHP configuration. Since
pxeboot is using TFTP to get to the files, pxeboot can not rely on NFS to
provide it a root directory hande as a side effect. pxeboot has to make RPC
mount call itself.
hrs [Sat, 12 Mar 2005 19:04:03 +0000 (19:04 +0000)]
New release notes:
jail(8) security.jail.chflags_allowed sysctl,
zs driver removed,
ng_ipfw(4) added,
ips(4) crash dump support,
getaddrinfo(3) DNS query order changed,
powerd(8) added, and
RFC derived manual pages replaced.
Update release notes:
acpi_throttle and acpi_perf merged into acpi and
can be disabled via device hints, and
some rewording due to zs driver removal in the entry which
explains uart(4) has been enabled by default on FreeBSD/sparc64.
marius [Sat, 12 Mar 2005 17:06:03 +0000 (17:06 +0000)]
In uart_cpu_getdev_console() when determinig whether we should use
a serial console anyway because input-device is set to keyboard and
output-device is set to screen but no keyboard is plugged in don't
assume that a device node for the input-device alias exists. While
this is true for RS232 keyboards (the node of the SCC and UART
respectively which controls the keyboard doesn't disappear when no
keyboard is plugged in) this assumption breaks for USB keyboards.
It's most likely also not true for PS/2 keyboards but OFW doesn't
reliably switch to a serial console when the potential keyboard is
a PS/2 one which isn't plugged in so this couldn't be verified
properly.
Reported by: Will Andrews <will@csociety.org>, obrien
MFC after: 1 week
rwatson [Sat, 12 Mar 2005 13:39:39 +0000 (13:39 +0000)]
Extend the coverage of the accept and socket mutexes in soisconnected()
so that the socket lock is held over the test-and-set removal of the
accept filter option during connect, and the two socket mutex regions
(transition to connected, perform accept filter) are combined.
rwatson [Sat, 12 Mar 2005 12:57:18 +0000 (12:57 +0000)]
Move the logic implementing retrieval of the SO_ACCEPTFILTER socket option
from uipc_socket.c to uipc_accf.c in do_getopt_accept_filter(), so that it
now matches do_setopt_accept_filter(). Slightly reformulate the logic to
match the optimistic allocation of storage for the argument in advance,
and slightly expand the coverage of the socket lock.
rwatson [Sat, 12 Mar 2005 12:27:47 +0000 (12:27 +0000)]
Part two of post-SMPng cleanup of accept filter registration: perform all
allocation up front before grabbing the socket mutex and doing the
registration work. The result is a lot cleaner.
scottl [Sat, 12 Mar 2005 07:01:53 +0000 (07:01 +0000)]
Guard against an integer underflow that could cause busdma to eat up all
available RAM. This also results in the global bounce page limit being
applied to zones instead of globally.
mux [Sat, 12 Mar 2005 02:43:50 +0000 (02:43 +0000)]
Fix a long-standing bug in alpha's implementation of busdma. We need to
OR the physical address with alpha_XXX_dmamap_or to get the DMA address,
like the name of the variable suggests. However, while we were doing
this correctly in the alpha_XXX_dmamap() macro, the busdma code added
the variable to the physical address instead of or'ing it. Fortunately
and if my math is not entirely wrong, you would need more than 128GB of
RAM and a device able to do DMA in 64bits to experience the bug.
njl [Fri, 11 Mar 2005 23:27:45 +0000 (23:27 +0000)]
The mbnambuf routines combine multiple substrings into a single
long filename. Each substring is indexed by the windows ID, a
sequential one-based value. The previous code was extremely slow,
doing a malloc/strcpy/free for each substring.
This code optimizes these routines with this in mind, using the ID
to index into a single array and concatenating each WIN_CHARS chunk
at once. (The last chunk is variable-length.)
This code has been tested as working on an FS with difficult filename
sizes (255, 13, 26, etc.) It gives a 77.1% decrease in profiled
time (total across all functions) and a 73.7% decrease in wall time.
Test was "ls -laR > /dev/null".
Per-function time savings:
mbnambuf_init: -90.7%
mbnambuf_write: -18.7%
mbnambuf_flush: -67.1%
peter [Fri, 11 Mar 2005 22:16:09 +0000 (22:16 +0000)]
Remove diffs to i386 version that came in via the compiler support ifdefs.
This changes things like whitespace, inconsistent use of #ifndef vs
#if !defined(), different macro argument orders, mismatched comments, etc.
rwatson [Fri, 11 Mar 2005 21:37:45 +0000 (21:37 +0000)]
First step in simplifying accept filter socket option logic in the
post-SMPng world order. Centralize handling of the socket option
clear case in do_setopt_accept_filter().
sam [Fri, 11 Mar 2005 19:40:34 +0000 (19:40 +0000)]
reorder ath_rate_onoe to after ath_rate_sample so it gets used as the
default rate control algorithm; this should be done differently but for
now use this simple solution
rwatson [Fri, 11 Mar 2005 16:30:02 +0000 (16:30 +0000)]
When setting up a socket in socreate(), there's no need to lock the
socket lock around knlist_init(), so don't.
Hard code the setting of the socket reference count to 1 rather than
using soref() to avoid asserting the socket lock, since we've not yet
exposed the socket to other threads.
This removes two mutex operations from each socket allocation.
rwatson [Fri, 11 Mar 2005 15:06:16 +0000 (15:06 +0000)]
The SO_NOSIGPIPE socket option allows a user process to mark a socket
so that the socket does not generate SIGPIPE, only EPIPE, when a write
is attempted after socket shutdown. When the option was introduced in
2002, this required the logic for determining whether SIGPIPE was
generated to be pushed down from dofilewrite() to the socket layer so
that the socket options could be considered. However, the change in
2002 omitted modification to soo_write() required to add that logic,
resulting in SIGPIPE not being generated even without SO_NOSIGPIPE when
the socket was written to using write() or related generic system calls.
This change adds the EPIPE logic to soo_write(), generating a SIGPIPE
signal to the process associated with the passed uio in the event that
the SO_NOSIGPIPE option is not set.
Notes:
- The are upsides and downsides to placing this logic in the socket
layer as opposed to the file descriptor layer. This is really fd
layer logic, but because we need so_options, we have a choice of
layering violations and pick this one.
- SIGPIPE possibly should be delivered to the thread performing the
write, not the process performing the write.
- uio->uio_td and the td argument to soo_write() might potentially
differ; we use the thread in the uio argument.
- The "sigpipe" regression test in src/tools/regression/sockets/sigpipe
tests for the bug.
Submitted by: Mikko Tyolajarvi <mbsd at pacbell dot net>
Talked with: glebius, alfred
PR: 78478
MFC after: 1 week
harti [Fri, 11 Mar 2005 13:24:08 +0000 (13:24 +0000)]
Simplify the print routines by using LST_FOREACH instead of Lst_ForEach
and inlining the small printing utility functions.
Create a function that can be used to produce printable representations
of flag words.
harti [Fri, 11 Mar 2005 13:02:38 +0000 (13:02 +0000)]
Remove leading underscores from the pathname defines. All identifiers
with leading underscore followed by an uppercase letter are in the
implementation namespace.
rwatson [Fri, 11 Mar 2005 12:47:14 +0000 (12:47 +0000)]
Add sigpipe, a simple UNIX domain socket and TCP regression test that is
intended to verify that SIGPIPE is delivered to a process writing or
sending on a socket that has been shut down for write. If available,
SO_NOSIGPIPE is also tested.
This regression test is currently passed by RELENG_4, but not by HEAD or
RELENG_5, due to a bug in the write() code for sockets. SO_NOSIGPIPE is not
present in RELENG_4, however, so is not tested there.
Reported by: Mikko Tyolajarvi <mbsd at pacbell dot net>
PR: 78478
harti [Fri, 11 Mar 2005 11:29:39 +0000 (11:29 +0000)]
Call ParseFinishLine() also for the last line in a file. This
patch differs from the previous one in that it calls the function
only when a real file hits EOF. The bodies of .for loops are also
handled as files, but for these we don't want to end a dependency block
on the 'EOF' as in:
imp [Fri, 11 Mar 2005 07:03:46 +0000 (07:03 +0000)]
Make the pps interrupt register as MPSAFE and FAST. Use a spin lock
to syncrhonize access to the data as a result. This makes the pps
less likely to miss the 1ms pulse that I'm feeding it, but not
entirely reliable yet on my 133MHz P5.
imp [Fri, 11 Mar 2005 05:27:05 +0000 (05:27 +0000)]
Revert changes of 1.49. Lots-a-people broke with it, for reasons
unknown (since my sony vaio didn't :-(.
Instead, fix the problem described by 1.49 in a different way: just
add the two calls I'd hoped I'd avoid in 1.49 by doing the (wrong)
gymnastics there. While 1.49 is a good direction to go in, each step
of the way should work :-(.