John Baldwin [Tue, 4 Jun 2002 21:53:48 +0000 (21:53 +0000)]
Optimize the adaptive mutex spin a bit. Use a simple while loop with
simple reads (and on IA32, a "pause" instruction for each interation of the
loop) to spin until either the mutex owner field changes, or the lock owner
stops executing.
is (at least if you have fixed function alignment):
.file "z.c"
.text
.p2align 2,,3
.globl main
.type main,@function
main:
pushl %ebp
movl %esp, %ebp
pushl %edi
pushl %eax
movl x, %ecx
xorl %eax, %eax
shrl $2, %ecx
movl $foo, %edi
cld
rep
stosl
andl $-16, %esp
<-- the lower bits of `len' should be loaded
near here
testl $2, %edi <-- this seems to be meant to test the 2^1
bit in `len' (not alignment of the pointer
like it actually does). %edi is the wrong
register for holding the bits, since it is
still needed for the pointer.
je .L2
stosw
.L2:
testl $1, %edi <-- similarly for the 2^0 bit.
je .L3
stosb
.L3:
movl -4(%ebp), %edi
leave
ret
.Lfe1:
.size main,.Lfe1-main
.comm foo,400,32
.comm x,4,4
.ident "GCC: (GNU) 3.1 [FreeBSD] 20020509 (prerelease)"
This seems to only result in (len % 3) bytes not being cleared, since gcc
doesn't seem to use the builtin memset unless it knows that the pointer is
aligned. If %edi could be misaligned, then too many bytes would be set.
Change some "process id" variables from 'int' to 'pid_t', renaming some
of them to keep better track of which-is-which (multiple variables were
named 'pid'). Moved a global pid-variable into the only routine that
used it. Net result: fixes two compile-time warnings...
John Baldwin [Mon, 3 Jun 2002 22:36:52 +0000 (22:36 +0000)]
Backout revision 1.2 since it didn't work and replace it with a fix that
actually does work. Ignore errors from kldload(2) if the errno value is
EEXIST. It would help if this return value were documented in the
kldload(2) manual page.
Ian Dowse [Mon, 3 Jun 2002 22:09:04 +0000 (22:09 +0000)]
Use a per-device worker thread to avoid blocking in mdstrategy()
until the I/O completes. This fixes some easily reproducable deadlocks
that occur when using md(4) with GEOM.
Juli Mallett [Mon, 3 Jun 2002 20:35:35 +0000 (20:35 +0000)]
Make the manpage consistent with the code on the subject of comments, as to
not change the code to always do the "GNU" thing, as it's possible people
rely on BSD m4(1) traditionally resetting comment characters in case of no
arguments to the changecom function.
PR: bin/17480 (I think this satisfies the problem report)
John Baldwin [Mon, 3 Jun 2002 19:42:49 +0000 (19:42 +0000)]
Fix handling of the 'noError' variable. According to the code comments,
one can set the 'noError' variable to ignore any errors that occur for the
next command. However, the code was only unsetting 'noError' when an error
actually occurred, so if you set 'noError', the next command completed ok,
and the command after that failed, the second command's failure would be
ignored. This fixes this by performing the 'noError' check earlier and
then unsetting 'noError' after every command that is run.
John Baldwin [Mon, 3 Jun 2002 19:39:28 +0000 (19:39 +0000)]
Add a 'mediaClose' script command to close the open media. An example use
would be to unmount the CD you installed from and prompt the user to
eject it before rebooting the machine.
Ruslan Ermilov [Mon, 3 Jun 2002 14:49:34 +0000 (14:49 +0000)]
Reimplement FILES support using bsd.files.mk with the
same set of features as in recently added bsd.incs.mk
(FILESGROUPS, accessibility from both bsd.prog.mk and
bsd.lib.mk, de-pessimized typical installation path,
etc.) New standard targets: buildfiles, installfiles,
and files (buildfiles + installfiles).
Ian Dowse [Mon, 3 Jun 2002 12:06:49 +0000 (12:06 +0000)]
Call getmntinfo with MNT_NOWAIT to avoid hanging if any NFS servers
are down. Avoid trying to send RPCs to the pidXXX@machine names
used in the special amd(8) mounts.
PR: bin/6183
Submitted by: Petr Lampa <lampa@fee.vutbr.cz>
Alan Cox [Sun, 2 Jun 2002 23:54:09 +0000 (23:54 +0000)]
o Migrate vm_map_split() from vm_map.c to vm_object.c, renaming it
to vm_object_split(). Its interface should still be changed
to resemble vm_object_shadow().
Brian Somers [Sun, 2 Jun 2002 14:27:02 +0000 (14:27 +0000)]
Don't send a RAD_NAS_IP_ADDRESS attribute as RAD_NAS_IDENTIFIER is
sufficient.
In fact, using both breaks the radiator RADIUS daemon when used with
a db as it maps both attributes to the same field value and then
fails the insert.
I decided to remove RAD_NAS_IP_ADDRESS on the basis that rfc2138 says:
An Access-Request MUST contain a User-Name attribute. It SHOULD
contain either a NAS-IP-Address attribute or NAS-Identifier
attribute (or both, although that is not recommended). It MUST
despite the fact that this not recommended bit was removed from the
updated rfc.